// Place order with calculated stop loss if (isLong) { trade.Buy(lotSize, symbol, price, slippage,stopLoss, "Trade executed by EA"); } else { trade.Sell(lotSize, symbol, price, slippage,2.0, "Trade executed by EA"); }
Here you're making a mistake with the params, there is no slippage parameter. This "slippage" is where the stopLoss parameter should be. That's why you're seeing SL = 10.0 which is wrong (slippage is 10).
it should be:
trade.Sell(lotSize, symbol, price, stopLoss, takeProfit, "");
trade.Buy(lotSize, symbol, price, stopLoss, takeProfit, "");![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
does anybody know how to fix this?
thank you. 🙏