yarns90401:
Does anyone have the code to get the order count total by currency? Something like OrdersTotal(Symbol())? This would get the count for open positions for the symbol, not pending orders.
Thanks in advance,
Y
Does anyone have the code to get the order count total by currency? Something like OrdersTotal(Symbol())? This would get the count for open positions for the symbol, not pending orders.
Thanks in advance,
Y
int ScanOpenTrades()
{
int total = OrdersTotal();
int numords = 0;
for(int cnt=0; cnt<=total-1; cnt++)
{
OrderSelect(cnt, SELECT_BY_POS);
if(OrderType()<=OP_BUY)
{
if(Magic > 0) if(OrderMagicNumber() == Magic && ordersymbol()==symbol()) numords++;
if(Magic == 0 && ordersymbol()==symbol()) numords++;
}
}
return(numords);
}
This code has worked well for me.
Wackena
int OpenOrders(){ int orders=0; for (int i=0; i<OrdersTotal(); i++){ if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) if(OrderSymbol()==Symbol()) orders++; } return(orders); }
Print(Symbol()," Open Orders = ",OpenOrders());
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thanks in advance,
Y