About right, yes, thank you. In that case, if you save to objects, you'd better have unique majicies instead of tickets, otherwise there will be dozens of objects with the same name.
StringToInteger(ObjectName(0,i,0)
A typo? I think both functions can only take one parameter.
Nerd Trader #: If you do it through an array, then check only the ticks of modified orders written to it against all the others.
About right, yes, thanks. In that case, if we're saving to objects, we'd better have unique majicks instead of tickets, otherwise there will be dozens of objects with the same name.
A typo? I think both functions can only take one parameter.
By the way, do you happen to know why the following error occurs periodically? For 100 successfully opened orders, there are about 10 of these.
2021.10.10 16:18:09.853 2021.01.05 21:15:00 test EURUSD,M5: 4051 | order.sl_price: 2.813499706815862e-262
2021.10.10 16:18:09.853 2021.01.05 21:15:00 test EURUSD,M5: OrderSend error 4051
2021.10.10 16:18:09.853 2021.01.05 21:15:00 test EURUSD,M5: unknown trade cmd 406958564 for OrderSend function
order.sl_price: 2.813499706815862e-262 - stoploop price, clearly this number should not be. 4051 - "Invalid value of function parameter" - is this the order type? Shouldn't be a problem with that either.
By the way, do you happen to know why the following error occurs periodically? For 100 successfully opened orders, there are about 10 of these.
order.sl_price: 2.813499706815862e-262 - stop price, clearly this number should not be. 4051 - "Invalid value of function parameter" - is this the order type? There should not be any problems with it either.
//+----------------------------------------------------------------------------+//| Автор : Ким Игорь В. aka KimIV, http://www.kimiv.ru |//+----------------------------------------------------------------------------+//| Версия : 19.02.2008 |//| Описание : Возвращает суммарный профит открытых позиций в пунктах |//+----------------------------------------------------------------------------+//| Параметры: |//| sy - наименование инструмента ("" - любой символ, |//| NULL - текущий символ) |//| op - операция (-1 - любая позиция) |//| mn - MagicNumber (-1 - любой магик) |//+----------------------------------------------------------------------------+int GetProfitOpenPosInPoint(string sy="", int op=-1, int mn=-1) {
double p;
int i, k=OrdersTotal(), pr=0;
if (sy=="0") sy=Symbol();
for (i=0; i<k; i++) {
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
if ((OrderSymbol()==sy || sy=="") && (op<0 || OrderType()==op)) {
if (mn<0 || OrderMagicNumber()==mn) {
if (OrderTicket()== GetTicketMaxMinOrder(0) || OrderTicket()== GetTicketMaxMinOrder(1) ) {
p=MarketInfo(OrderSymbol(), MODE_POINT);
if (p==0) if (StringFind(OrderSymbol(), "JPY")<0) p=0.0001; else p=0.01;
if (OrderType()==OP_BUY) {
pr+=(MarketInfo(OrderSymbol(), MODE_BID)-OrderOpenPrice())/p;
}
if (OrderType()==OP_SELL) {
pr+=(OrderOpenPrice()-MarketInfo(OrderSymbol(), MODE_ASK))/p;
}
}
}
}
}
}
return(pr);
}
Makar has inserted code into the EA so far only to compare profit in currency and profit in pips as far as I understand it can be understood when these functions have zero values
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.
You still need to check the conditions on each new tick, and if it didn't work on the previous tick, it will change on the new one.
And error handling has to be done.
A typo? I think both functions can only take one parameter.
If you do it through an array, then check only the ticks of modified orders written to it against all the others.
About right, yes, thanks. In that case, if we're saving to objects, we'd better have unique majicks instead of tickets, otherwise there will be dozens of objects with the same name.
A typo? I think both functions can only take one parameter.
They won't.
Sorry
h ttps://www.mql5.com/ru/docs/objects/objectname
This is for MT5
and this is for MT4
They won't.
Sorry
By the way, do you happen to know why the following error occurs periodically? For 100 successfully opened orders, there are about 10 of these.
2021.10.10 16:18:09.853 2021.01.05 21:15:00 test EURUSD,M5: 4051 | order.sl_price: 2.813499706815862e-262 2021.10.10 16:18:09.853 2021.01.05 21:15:00 test EURUSD,M5: OrderSend error 4051 2021.10.10 16:18:09.853 2021.01.05 21:15:00 test EURUSD,M5: unknown trade cmd 406958564 for OrderSend functionorder.sl_price: 2.813499706815862e-262 - stoploop price, clearly this number should not be.
4051 - "Invalid value of function parameter"
- is this the order type? Shouldn't be a problem with that either.
Do you mean "min and max" by ticket or price?
By ticket
By the way, do you happen to know why the following error occurs periodically? For 100 successfully opened orders, there are about 10 of these.
order.sl_price: 2.813499706815862e-262 - stop price, clearly this number should not be.
4051 - "Invalid value of function parameter"
- is this the order type? There should not be any problems with it either.
Try to move "NormalizeDouble"
By ticket
Try moving "NormalizeDouble"
unchanged.
Makar has inserted code into the EA so far only to compare profit in currency and profit in pips as far as I understand it can be understood when these functions have zero values