Guys i finally made a robot that buys whenever a bullish candle open but now the problem is my trailing stop, for example the robot place a buy
order and i'm trailing in profit but when the market starts going against my direction the trailing stop doesn't close the locked
profit ending up in a loss trade, so please help anyone
here is the code guys, please see what you can find mql5

Documentation on MQL5: Constants, Enumerations and Structures / Trade Constants / Position Properties
- www.mql5.com
Position ticket. Unique number assigned to each newly opened position. It usually matches the ticket of an order used to open the position except when the ticket is changed as a result of service operations on the server, for example, when charging swaps with position re-opening. To find an order used to open a position, apply the...
- Flexible MetaTrader 5 trading system with all order types
- MetaTrader 5 for your employees
- MQL5 Wizard: Development of trading robots for MetaTrader 5

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