Another problem
Thanks, it worked. I can understand I can scew up code I write but now I even mess up pre-written code :(
I fixed with lots of help all the scew-ups now so its ok though :)
//Next 7 lines are from Ahmed Soliman of http://www.xpworx.com OrderSelect(0,SELECT_BY_POS,MODE_TRADES); if(OrderType()==OP_BUY) OrderClose(OrderTicket(),OrderLots(),Bid,5,Violet); if(OrderType()==OP_SELL) OrderClose(OrderTicket(),OrderLots(),Ask,5,Violet); if(OrderType()>OP_SELL) OrderDelete(OrderTicket()); donttrade=1; }If there are no open orders then OrderSelect fails and the remainder is nonsense. In addition the code means you can run the EA on ONE chart only, no other EAs, no manual trades.
for(pos = OrdersTotal()-1; pos >= 0 ; pos--) if ( OrderSelect(pos, SELECT_BY_POS) // Only my orders w/ && OrderMagicNumber() == magic.number // my magic number && OrderSymbol() == Symbol() ){ // and my pair. if(OrderType() <=OP_SELL) OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),5,Violet); else OrderDelete(OrderTicket()); donttrade=1; }
I am having another problem I can't find a fix to. This time I'm getting warnings about the Start function: Start function not found and cannot be run, init function defined - start function's parameters will be ignored as expert properties and Function "Start" is not referenced and will be removed from exp-file. It seems that it doesen't see the Start function. Any help would be great.