Thank you for the contribution ...
void HiddenTPSL() { bool clo; //while(OrdersTotal()>0) { for(int i=OrdersTotal()-1; i>=0; i--) { if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)) { if(OrderSymbol()==Symbol() && OrderMagicNumber()==MagicID) { if(OrderType()==OP_BUY) { if (Bid>=OrderOpenPrice()+TP*g_Point) { clo=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,clrAqua); Print("Closed PROIT Buy Orders"); } } if(OrderType()==OP_SELL) { if (Ask<=OrderOpenPrice()-TP*g_Point) { clo=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,clrAqua); Print("Closed PROGIT Sell Orders"); } } if(OrderType()==OP_BUY) { if (Bid<=OrderOpenPrice()-SL*g_Point) { clo=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,clrAqua); Print("Closed STOP LOSS BUY Orders"); } } if(OrderType()==OP_SELL) { if (Ask>=OrderOpenPrice()+SL*g_Point) { clo=OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),Slippage,clrAqua); Print("Closed STOPLOSS SELL Sell Orders"); } } break; } } } } }This simple will do the Job

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
Hidden TP and SL:
Author: Tadeusz Kiesner