void is simpler
the void isnt returning anything, but you can still change variables that are global to the ea, such as the buys, sells
all i ever need is the void
other types can be used
but you need return()
because thats the value returned
hope that helps
the void isnt returning anything, but you can still change variables that are global to the ea, such as the buys, sells
all i ever need is the void
other types can be used
but you need return()
because thats the value returned
Inserted Code
orders2(0,0); // this goes in start() , iv given a and b a default value int orders2(int a ,int b) // here im saying that a and b are type int { int totalorders = OrdersTotal(); for(int i=totalorders-1;i>=0;i--) { OrderSelect(i, SELECT_BY_POS); if ( OrderType() == OP_BUY) {a++;} if ( OrderType() == OP_SELL ) {b++;} } return(a+b); // here im returning a+b }
hope that helps