I'm start a thread for save my learning code block MT4.
I decide learning code (so far copy paste modifier
) because of this > https://www.forexfactory.com/thread/...6#post13238686
and post again on > https://www.forexfactory.com/thread/...0#post13239810
this was my first time post and was so amazing EPIC REQUEST



and solved by BlueRain > https://www.forexfactory.com/thread/...8#post13240128
If many any coder master want to share easy code block. Really Appreciate

I start with
for count all trades
I decide learning code (so far copy paste modifier
and post again on > https://www.forexfactory.com/thread/...0#post13239810
this was my first time post and was so amazing EPIC REQUEST
and solved by BlueRain > https://www.forexfactory.com/thread/...8#post13240128
If many any coder master want to share easy code block. Really Appreciate
I start with
for count all trades
Inserted Code
//+------------------------------------------------------------------+
//| Count All Open Order function |
//+------------------------------------------------------------------+
int CountAllOpenTrades() {
int cntorder = 0;
for (int allordercnt = OrdersTotal() - 1; allordercnt >= 0; allordercnt--)
{
if(OrderSelect(allordercnt, SELECT_BY_POS, MODE_TRADES))
if (OrderSymbol() != Symbol() || OrderMagicNumber() != MagicNumber) continue;
if (OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNumber)
if (OrderType() == OP_SELL || OrderType() == OP_BUY) cntorder++;
}
//---
return (cntorder);
}
//+------------------------------------------------------------------+ Margin Call again and again...