Скрипт при исполнении делает файл с историей в папку ексерт\филес\ имя файла (это номер счета)
Все очень просто скрипт на 3 терминалах исполняется скажем в 6 утра автоматом
Значит нам не надо открывать терминалы - отрываем базу и новые данные уже в ней подхвачены готовые к анализу (это уже реализовано)
% деятельности с посчитанными свопами, сводными таблицами и графиками и т.д.
No script can open the terminal!
So if you want it to work, it must be on a terminal that is open and connected to the net. It will run at the required time and record the data. But the terminals must always be switched on.
double min =100000; double lmax, // Threshold price, after it is passed // we consider selling (abs) lmin, // Same for Buy Lot;
int Count=0; int total=0; int Ticket=0; // Global variable. //-------------------------------------------------------------------- int init() // Special init()
{ int total=OrdersTotal(); // only open orders string Symbol1=Symbol(); double metka=0; for(int pos=0;pos<total;pos++) { if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)==false) continue; { if(OrderSymbol()==Symbol()) { metka=1; Alert("Order #", OrderTicket(), " in ", OrderSymbol());
} else { } }
}
if(metka==0 ) // if(metka==0 && UROVEN>=Ask)
{
double bid =MarketInfo(Symbol(),MODE_BID); // Request Bid value double ask =MarketInfo(Symbol(),MODE_ASK); // Request Ask value double min =MarketInfo(Symbol(),MODE_ASK); // Request Ask value double point =MarketInfo(Symbol(),MODE_POINT)//Query Point OrderSend(Symbol(),OP_BUYSTOP,Lots,bid+OTSTUP_BUY*Point,3,bid-1*Point,bid+TakeProfit*Point); int Ticket=OrderTicket(); //OrderSend(Symbol(),OP_BUYSTOP,Lots,BuyStop,3,StopLoss,TakeProfit, "Bye Stop 1"); Alert (Ticket); // Error message // Alert (Symbol()," ",OP_BUYSTOP," ",0.01," ",ask+10*Point," ",3," ",ask-35*Point," ",ask+35*Point); Alert (GetLastError()); }
return; // Exit init() }
//-------------------------------------------------------------------- int start() // Special. function start() { if(min>Bid) min=Bid; { // Count min price
int total=OrdersTotal(); // only open orders string Symbol1=Symbol(); for(int pos=0;pos<total;pos++) { if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)==false) continue; { if(OrderSymbol()==Symbol()) { Alert("Order #", OrderTicket(), " in ", OrderSymbol()); Alert (min); OrderModify(OrderTicket(),min+OTSTUP_BUY*Point,min-1*Point,min+TakeProfit*Point,0);//Modify Alert (GetLastError()); Alert(Symbol(), "",OrderTicket()), OrderTicket()," ",min+OTSTUP_BUY*Point," ",min-1*Point," ",min+TakeProfit*Point," ",0); } } }
I guess the problem is that I did not specify the number of elements in the array. But what if the number of elements is initially unknown and the array is filled in the loop? (in my case, when reading from a file)
mrddt>>: догадываюсьчто проблема в том что я не указал кол-во элементов в массиве. а что делать если кол-во элементов изначально неизвесно и массив заполняется в цикле? (в моём случае при чтении из файла)
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Good afternoon!
If a pending order is triggered by a script, how can I detach this script from the tool window?
Thank you in advance.
НЕТ
Скрипт при исполнении делает файл с историей в папку ексерт\филес\ имя файла (это номер счета)
Все очень просто скрипт на 3 терминалах исполняется скажем в 6 утра автоматомЗначит нам не надо открывать терминалы - отрываем базу и новые данные уже в ней подхвачены готовые к анализу (это уже реализовано)
% деятельности с посчитанными свопами, сводными таблицами и графиками и т.д.
No script can open the terminal!
So if you want it to work, it must be on a terminal that is open and connected to the net. It will run at the required time and record the data. But the terminals must always be switched on.
Добрый день!
Как сделать, если сработал отложенный скриптом ордер, чтобы этот скрипт отсоединить от окна инструмента?
Заранее благодарен.
the script is executed once on the graph and does not require manual disconnection.
скрипт выполняется на графике один раз и не требует ручного отсоединения.
Unfortunately, if it is not disconnected from the window, when the previous order is closed it opens the next order.
Here is its code
Shifts the pending order on price change
//--------------------------------------------------------------------
extern double OTSTUP_BUY = 7;
extern double TakeProfit = 100;
//extern double BuyStop = 0;
//extern double StopLoss = 0;
extern double Lots = 0.01;
//extern double TrailingStop = 21;
double min =100000;
double
lmax, // Threshold price, after it is passed
// we consider selling (abs)
lmin, // Same for Buy
Lot;
int Count=0;
int total=0;
int Ticket=0; // Global variable.
//--------------------------------------------------------------------
int init() // Special init()
{
int total=OrdersTotal(); // only open orders
string Symbol1=Symbol();
double metka=0;
for(int pos=0;pos<total;pos++)
{
if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)==false) continue;
{
if(OrderSymbol()==Symbol())
{
metka=1;
Alert("Order #", OrderTicket(), " in ", OrderSymbol());
}
else
{
}
}
}
if(metka==0 )
// if(metka==0 && UROVEN>=Ask)
{
double bid =MarketInfo(Symbol(),MODE_BID); // Request Bid value
double ask =MarketInfo(Symbol(),MODE_ASK); // Request Ask value
double min =MarketInfo(Symbol(),MODE_ASK); // Request Ask value
double point =MarketInfo(Symbol(),MODE_POINT)//Query Point
OrderSend(Symbol(),OP_BUYSTOP,Lots,bid+OTSTUP_BUY*Point,3,bid-1*Point,bid+TakeProfit*Point);
int Ticket=OrderTicket();
//OrderSend(Symbol(),OP_BUYSTOP,Lots,BuyStop,3,StopLoss,TakeProfit, "Bye Stop 1");
Alert (Ticket); // Error message
// Alert (Symbol()," ",OP_BUYSTOP," ",0.01," ",ask+10*Point," ",3," ",ask-35*Point," ",ask+35*Point);
Alert (GetLastError());
}
return; // Exit init()
}
//--------------------------------------------------------------------
int start() // Special. function start()
{
if(min>Bid) min=Bid;
{ // Count min price
int total=OrdersTotal(); // only open orders
string Symbol1=Symbol();
for(int pos=0;pos<total;pos++)
{
if(OrderSelect(pos,SELECT_BY_POS,MODE_TRADES)==false) continue;
{
if(OrderSymbol()==Symbol())
{
Alert("Order #", OrderTicket(), " in ", OrderSymbol());
Alert (min);
OrderModify(OrderTicket(),min+OTSTUP_BUY*Point,min-1*Point,min+TakeProfit*Point,0);//Modify
Alert (GetLastError());
Alert(Symbol(), "",OrderTicket()), OrderTicket()," ",min+OTSTUP_BUY*Point," ",min-1*Point," ",min+TakeProfit*Point," ",0);
}
}
}
}
return; // Exit init()
}
//--------------------------------------------------------------------
int deinit() // Special. f-iia deinit()
{
// Alert ("Deinit() f-iia triggered on unloading"); // Message
return; // Exit deinit()
}
//--------------------------------------------------------------------
string iii[];
iii[0] = "1";
iii[1] = "2";
iii[2] = "3";
MessageBox(iii[0]);
MessageBox(iii[1]);
MessageBox(iii[2]);
outputs the number 3 three times! instead of the proper 1, 2, 3.... WTF?
thanks!
догадываюсьчто проблема в том что я не указал кол-во элементов в массиве. а что делать если кол-во элементов изначально неизвесно и массив заполняется в цикле? (в моём случае при чтении из файла)
ArrayResize