Oh,thx so much! I'll try it.
Btw, another question, maybe U can help me :
if I have a buy order and a sell order at the same symbol .I'd like to close those two orders ,How can I control it in EA?
Need I use a globle variable or static or something....... and if globle can do it , how can I define a globle at mt3.86?
Best regards
Btw, another question, maybe U can help me :
if I have a buy order and a sell order at the same symbol .I'd like to close those two orders ,How can I control it in EA?
Need I use a globle variable or static or something....... and if globle can do it , how can I define a globle at mt3.86?
Best regards
void CloseOrders(string symbol) { int cnt = OrdersTotal(); for (int i=cnt-1; i >= 0; i--) { if (!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue; if (OrderSymbol() != symbol) continue; int type = OrderType(); if (type == OP_BUY) { CloseOrder(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_BID)); } if (type == OP_SELL) { CloseOrder(OrderTicket(), OrderLots(), MarketInfo(OrderSymbol(), MODE_ASK)); } } }
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
sorry for my english!
Beat regards