Hi guys,
someone has got a very simple code base on stop and reverse ?
I've some problem to handle this.
Or there is a funcion "CloseAll" differed by magicnumber like in mql4 ?
Regards
No Erocla
I don't know what's you mean :)
When your post there are some questions, please separate them with numbering.
Regards,
Yohana
Hi guys,
someone has got a very simple code base on stop and reverse ?
I've some problem to handle this.
Or there is a funcion "CloseAll" differed by magicnumber like in mql4 ?
Regards
No Erocla
Hi guys,
someone has got a very simple code base on stop and reverse ?
I've some problem to handle this.
Or there is a funcion "CloseAll" differed by magicnumber like in mql4 ?
Regards
No Erocla
CloseAll for All Order Opened by one click is good idea
Ok sorry, i show you the code for mt4:
int CloseAll()
{
int k;
int result;
int cnt;
//total = OrdersTotal();
for(cnt = OrdersTotal()-1; cnt >= 0; cnt--)
{
OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
if (OrderSymbol()==Symbol() && OrderMagicNumber()==magicNum)
{
if (OrderType()==OP_BUY)
{
for (k=0 ;k<3; k++)
{
result=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Bid,Digits),3,Violet);
if (GetLastError()==0) break;
else
{
Sleep(5000);
RefreshRates();
continue;
}
}
}
if (OrderType()==OP_SELL)
{
for (k=0 ;k<3; k++)
{
result=OrderClose(OrderTicket(),OrderLots(),NormalizeDouble(Ask,Digits),3,Violet);
if (GetLastError()==0) break;
else
{
Sleep(5000);
RefreshRates();
continue;
}
}
}
}
}
}
This function close all open orders by magicnumber.
There s something like this in mql5 too ?
Regards
No Erocla
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi guys,
someone has got a very simple code base on stop and reverse ?
I've some problem to handle this.
Or there is a funcion "CloseAll" differed by magicnumber like in mql4 ?
Regards
No Erocla