if (whatever){
if (whatever && whoCares){
CloseBuyPositions(); /////// Gets error: 'CloseBuyPositions' - function not defined
}
}
void CloseBuyPositions(){ /////// Gets error: 'CloseBuyPositions' - function declarations are allowed on global, namespace or class scope onlyfor(int i=OrdersTotal()-1; i >=0; i--){
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
string CurrencyPair=OrderSymbol();
if (_Symbol==CurrencyPair){
if (OrderType()==OP_BUY){
OrderClose(OrderTicket(),OrderLots(),Bid,10,Red);
}
}
}
}
I've checked it over and over again buy I'm not able to see what I'm doing wrong.
Do I need to declare that there's a function above the ontick or something?
I'm sure I'm making a newb mistake.
I've checked it over and over again buy I'm not able to see what I'm doing wrong.
Do I need to declare that there's a function above the ontick or something?