hi,
If you want to stop an ea trading when another ea (same ea, just on different pair) has more then 1 open order.
would you just use a counter to find how many open orders there are similar to this?
is this the best way?Code:int countallopen(int type,string symbol){ int cnt=0; if(OrdersTotal()>0){ for(i=OrdersTotal()-1;i>=0;i--){ OrderSelect(i,SELECT_BY_POS,MODE_TRADES); if(symbol==symbol && OrderType()==type && OrderMagicNumber()==magic)cnt++; } return(cnt); } }
thanks,
AR



Reply With Quote
