Forum

getting total orders and one from history

void OnTick () { int count = 1 ; for ( int i= OrdersTotal ()- 1 ; i >= 0 ; i--) if ( OrderSelect (i, SELECT_BY_POS, MODE_TRADES) && (OrderSymbol() == Symbol ())) { count= count + 5 ; } if (count> 2 ) { return ;} else {

Only one trade per symbol

guys i have this code that calculates the total no of trades online for the current symbol. Somehow it only works when z == 0. If z>0 then the code does not stop and it continues to run. void OnTick () { int total,z,j; total = OrdersTotal (); for (j= 0 ;j<total;j++) { OrderSelect