Strategy is loded, deinitialized, uninit reason 1 and removed and initialized. - THATS ALL.
I want it to change the variables or send orders if there is no any orders open.
If you know what is wrong with that, than help me please...
what i see first...
if( OrderSelect(n,SELECT_BY_POS,MODE_TRADES) )
continue;
if( OrderSymbol()==Symbol() )
continue;
mean, if select a order should continue in the loop with the next and do not fullfill the code below
or if the order symbol match with the symbol from chart then continue with next and do not fullfill code below.
u mean something like
if (OrderSelect(n,....)
{
if( OrderSymbol()!=Symbol() ) continue;
and then the rest ...
}
what i see first...
if( OrderSelect(n,SELECT_BY_POS,MODE_TRADES) )
continue;
if( OrderSymbol()==Symbol() )
continue;
mean, if select a order should continue in the loop with the next and do not fullfill the code below
or if the order symbol match with the symbol from chart then continue with next and do not fullfill code below.
u mean something like
if (OrderSelect(n,....)
{
if( OrderSymbol()!=Symbol() ) continue;
and then the rest ...
}
for( n=0; n<total; n++ ){ // count orders if( OrderSelect(n,SELECT_BY_POS,MODE_TRADES) ) continue; if( OrderSymbol()==Symbol() ) continue;Use forward logic, move your test out of the loop, you must count down in the presense of multiple order (multiple charts)
int count=0; for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair. count++; } if (count == 0){ ...
WHRoeder:
Use forward logic, move your test out of the loop, you must count down in the presense of multiple order (multiple charts)
int count=0; for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair. count++; } if (count == 0){ ...
//What is the role of "count" variable?

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Strategy is loded, deinitialized, uninit reason 1 and removed and initialized. - THATS ALL.
I want it to change the variables or send orders if there is no any orders open.
If you know what is wrong with that, than help me please...