DislikedHello everyone, I'm looking for a reliable MQL4 code snippet to implement a fixed, hidden stop loss (also known as a virtual stop loss) in my EA. The key requirements are: Fixed: The stop loss must be set at a fixed distance (e.g., 50 pips) from the entry price and not move. Hidden: It must be virtual, meaning the SL value is not sent to the broker with the OrderSend function. The EA must manage it on the client-side. Precise Closure: This is the most important part. The trade must be closed exactly when the price (Bid for Buy orders, Ask for Sell...Ignored
EA only sends an Order to open or close, or modify a trade.
So, if we want a stealth SL, we must send an Order to close a trade when the Market price (Ask or Bid) is <= or >= than our requested SL price. That's all we can do - there is nothing else we can do.
So, a StopLoss Order is safer than a stealth SL, because it's on the broker's server.
Your stealth SL is more risky, because the EA sends an Order (here your internet connection is very important), then when the Order arrives at the broker's server, it gets processed by that server, and then at which price the broker fills that order is dependent on many factors.
So, I am sorry, but your wishes are out of sync with reality...
Unless, you are able to find a broker who guaratnees all prices for you..........
.ex4/.ex5 files can't be fixed or modified / I'm not a coder!
1