int Total, OType=1; double Price, SL, TP, Lot; bool CloseBuy=False, CloseSell=False, OpenBuy=False, OpenSell=False; for(int Counter=1; Counter<=OrdersTotal(); Counter++) { if (OrderSelect(Counter-1,SELECT_BY_POS)==True) if (OrderSymbol()==Symbol() && OrderMagicNumber() == MagicNumber ??) { Ticket=OrderTicket(); OType=OrderType(); Price=OrderOpenPrice(); SL=OrderStopLoss(); TP=OrderTakeProfit(); Lot=OrderLots(); } }
shyftus:
Please show all your code . . . if not please make sure the code you have posted above is inside a function . . . the example has it inside start()
Trying to follow a tutorial on coding a simple MA x but I've run into issues before I've even got into the thick of it... it's 430am here so I'm probably just missing a ; or something but could use a second pair of eyes... the problems on the "for" says expression can not be used on global scale. Original code can be found at http://www.forexrazor.com/en-us/school/tabid/426/ID/435663/basic-ea-ma-cross
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Trying to follow a tutorial on coding a simple MA x but I've run into issues before I've even got into the thick of it... it's 430am here so I'm probably just missing a ; or something but could use a second pair of eyes... the problems on the "for" says expression can not be used on global scale. Original code can be found at http://www.forexrazor.com/en-us/school/tabid/426/ID/435663/basic-ea-ma-cross