Virtual Sl Tp and trailing Sl
This panel brings convenient functionality. It will make your manual or automated trading in the Meta Trader terminal more comfortable.
- This panel allows to hide the Stop Loss and Take Profit levels of your trades. The panel stores these levels in its memory. When the market price reached one of the levels, a trade is simply closed and terminal generates a message indicating that a virtual level was triggered. This feature can be disabled.
- there are 5 options for setting Stop Loss:
- Classic SL - fixed Stop Loss (pips_SL parameter)
- Trailing SL - when the distance from the current price to the trade opening price is greater than the value of the pips_TRSL parameter, Stop Loss is moved by pips_TRSL.
- Breakeven - Trailing SL until the "break even" price - similar to the previous one, but the algorithm works up to the trade opening previous
- Trailing SL "jumps" - when the position profit in pips is equal to the value of pips_TRSL_1, the Stop Loss level is set to the position opening price (to breakeven). If Stop Loss is at "breakeven" and the distance from the current price to the opening price becomes equal to pips_TRSL_2, the Stop Loss order is moved away from the opening price to fix the profit in pips equal to pips_TRSL_3. This Trailing Stop Loss method is very efficient, it has been tested on different strategies. The algorithm is shows on the screenshot below.
- invisible_money_management_inp - false - the Stop Loss and Take Profit levels are output to the market. True - the levels are virtual and you broker "cannot see" them
- need_live_sl_inp- true - if invisible_money_management_inp = true, SL levels are set to the market, located away from the virtual SL by live_sl_point_inp points.
- live_sl_point_inp - described above
- all_orders_or_by_magic: All_orders - work with all orders on this symbol. Only_by_magic - work with orders and specific magic, specified in the magic_number parameter
- magic_number - magic number (described above). If it is set to less than or equal to 0, then the EA automatically works with all magic numbers
- color_of_SL - color of the SL line when using virtual SL, TP.
- color_of_TP - color of the TP line when using virtual SL, TP.
- TP_point_inp - distance of the Take Profit level from the trade opening price (specified in point)
- need_TP_inp - use Take Profit.
- type_of_trailing_inp - type of trailing sl (types are described above)
- TRSL_point_inp; SL_point_inp; TRSL_1_point_inp; TRSL_2_point_inp; TRSL_3_point_inp - values for setting SL and trailing SL (in points)
- visual_panel_DRAW - draw the visual panel. Offset from the chart corner to the visual parameter is defined by the following parameters: visual_panel_X; visual_panel_Y
- ON_when_start_inp - enable working on startup (can be enabled after startup suing the visual panel)
If the virtual SL/TP levels are enabled and for some reason the connection between the terminal and broker is lost (connection interruption, broker not responding or something else), trades will not be closed when those levels are reached
2 - added the ON/OFF button to the visual panel