OrderType returning void, instead of int.

 

Hi,

While running this code snippet, error is coming saying OrderType returns void.

CODE:

for (int i=OrdersTotal()-1 ; i>=0 ; i--) {

      if (OrderSelect(i, SELECT_BY_POS)) {

      OrderPrint();

      Print(OrderType());

}

}

ERROR:

expression of 'void' type is illegal 1 1


OrderType should return int type, but in my mt4 it is not working and returning nothing (void).

can anyone please help to fix this.


Thanks.



 
   
Be sure to wrap your code using the Code button

 Try commenting out OrderPrint() and see if it works
for (int i=OrdersTotal()-1 ; i>=0 ; i--) {
  if (OrderSelect(i, SELECT_BY_POS)) {
    // OrderPrint();

    Print(OrderType());
  }
}
 

it is working now.

I made a mistake.