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
chk_buy=0; chk_sell=0;
int totalorders = OrdersTotal();
for(int i=0;i<totalorders;i++)
{
OrderSelect(i, SELECT_BY_POS);
if ( OrderSymbol()==Symbol())
{ if ( (OrderType()==OP_BUY ||OrderType()==OP_BUYLIMIT) && OrderOpenPrice()==buy_order) chk_buy=1;
if ( (OrderType()==OP_SELL||OrderType()==OP_SELLLIMIT)&& OrderOpenPrice()==sell_order) chk_sell=1;
}
}
/////////////////////////////////////////////////////////
What's wrong with my script? I don't want the expert to buy or sell at levels which already have open position, and it doesn't seem to work. Anyone?