if(!OrderSelect(i, SELECT_BY_POS) || OrderSymbol()!=_Symbol) continue; int type = OrderType(); bool result = false; switch(type) { case OP_BUYLIMIT : result = OrderDelete( OrderTicket() ); continue; case OP_BUYSTOP : result = OrderDelete( OrderTicket() ); continue; case OP_SELLLIMIT : result = OrderDelete( OrderTicket() ); continue; case OP_SELLSTOP : result = OrderDelete( OrderTicket() ); continue; case OP_BUY : result = OrderClose( OrderTicket(), OrderLots(), Bid, 50, clrRed ); continue; case OP_SELL : result = OrderClose( OrderTicket(), OrderLots(), Ask, 50, clrRed ); }
btw this expression:
if((BUY && iClose(NULL,0,1)<=Price_Target && Ask <= Price_Target) || (SELL && iClose(NULL,0,1)>=Price_Target && Bid >= Price_Target))
does the opposite of this:
If BUY is true, when anytime a Candle close Ask Price is above or equal to "Price Target", it will close and delete all orders.
If SELL is true, when anytime a Candle Close Bid Price is below or equal to "Price Target", it will close and delete all orders.
should be:
if((BUY && iClose(NULL,0,1)>=Price_Target && Ask >= Price_Target) || (SELL && iClose(NULL,0,1)<=Price_Target && Bid <= Price_Target))

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
Hi, i already recreate an EA to what i want but i'm having issues... all error been fix.. but the EA close all pairs orders.. I just want the EA to close on 1 pair which the EA been placed... Could tell me where is the error?
Is the error on either of this?
or
And also,
NULL is the current symbol right? followed by 0 means the current TF am i right? or i must put NULL in order for it to get the info from current TF?
Thank You