Since latest mt4 update, when I compile my EA I am getting the 'i' - undeclared identifier error but cannot see which part of this code is causing it:
if ((Ask-Bid) <= MaxSpread*PipValue*Point)
int orderstotal = OrdersTotal();
int orders = 0;
for (int i = 0; i < orderstotal; i++)
if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES))
if (OrderType() != OP_SELL || OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumberSell)
ordticket[orders] = OrderOpenTime();
ordticket[orders] = OrderTicket();
if (orders > 1)
for (i = 0; i < orders; i++)
if (OrderSelect(ordticket[i], SELECT_BY_TICKET) == true)
bool ret = OrderClose(OrderTicket(), OrderLots(), OrderClosePrice(), MaxSlippage, Red);
if (ret == false)
Print("OrderClose() error - ", ErrorDescription(GetLastError()));
for (int i = 0; i < orders; i++)
I have the same problem. Undeclared identifier for Li_20 on before last line. Any idea where is my mistake?
I doubt anyone here will be willing to help you debug decompiled code. In fact, if I were you I'd remove it before the moderator sees it.
Ask the owner of the source code to give it to you or have him fix it for
Decompiled code is stolen code. Either you are a thief, a fence, or the receiver of stolen (intellectual) property.
Either way we will not be an accomplice after the fact to theft.
See also forum.MQL4.com/41864#490649
If you post decompiled code again, you will likely be banned.
Don't tell us you found it on the 'net: if someone stole your bank details
and uploaded them on to the internet, is it OK for everyone to use them because
"someone uploaded it, I don't know why I can't use that"?