Stop loss and take profit helper by Mutabor
The utility is designed for two purposes:
- Automatic setting of stop loss and take profit levels.
- Automatic modification of stop loss and take profit levels when a certain profit is reached.
When the utility is started, the default values are configured for the М1 timeframe as follows.
- init stop loss - initial stop loss in points, set when an order is opened. (100 points)
- init take profit - initial take profit in points, set when an order is opened. (100 points)
- when begin move tp/sl levels - the number of points missing until the take profit level. (25 points)
- on/off level moving - enable/disable moving levels with the price. (true)
- take profit after move - new take profit value. Set after the difference between the levels of the first and third parameters is reached. (50 points)
- stop loss after move - new stop loss value. Set after the difference between the levels of the first and third parameters is reached. (50 points)
Instruction manual for an example of preset values
- You open a position. levels from the first two parameters (100 points of stop loss and 100 points of take profit) are set immediately.
- When the price moves in the profitable direction, if the profit exceeds the difference between parameters init stop loss and when begin move tp/sl levels (100 - 25 = 75 points), the take profit and stop loss levels are shifted to the new values take profit after move and stop loss after move points away from the current price.
- That is, the new values are equal to +50 and -50 points from the new price.
- You have a breakeven of 25 = (-100 (initial value) + 75 (reached level) + 50 (new value)) points. The new take profit value is 125 = (75+50).
- Now, if the price continues to move in the direction of profit, when 100 points (75+25) are exceeded, the protective levels will be moved by another 25 points (half of 50 - the new value of take profit).
- Thus, breakeven secures 50 points of profit, the current price is 100, the take profit value is 150 points from the position opening price.
- After 25 more points, the process will be repeated and another 25 points will be secured by breakeven.
Does not use trailing stop.
Play around with the parameters to find the optimal values for your trading style.
Also, the minimum stop loss and take profit levels should be determined manually, the program does not do that automatically. It only moves the levels depending on your expectations.
Important! Do not set zero values to the parameters, as this may affect the correct operation of the program.
Make sure that the symbol and spread allow using the entered values of protective orders.
Demo version: https://www.mql5.com/en/market/product/28559