Stop loss - Conditional (Pro)
The Stop loss - Conditional (Pro) module sets a stop loss (SL) when a condition becomes true, at a value you calculate yourself, for example the Low of the previous bar. It can trail the SL, remove it again on another condition and close only part of a position. It needs a Pro subscription.
How it works
Section titled “How it works”- The order opens without an SL (see ‘1’ in the image).
- When the Precondition becomes true, the SL is set at the SL start value ± SL offset (see ‘2’ in the image). Then it trails the price with every new high.
- When the price hits the SL, the module closes the Close percentage of the position (see ‘3’ in the image).
- If When to remove SL becomes true before that, the SL is removed again.
The SL of a buy order is set anywhere you want below the current price, not necessarily below the open price. So the order can be in profit when the SL is hit. For a sell order, everything is reversed.
Settings
Section titled “Settings”- Name: optional, tells this module apart from others of the same kind. See Name.
- Enabled for: Buy orders, Sell orders or Buy and Sell orders. If buy and sell orders need a different condition, add this module once for buy orders and once for sell orders.
- Precondition (optional): the condition that must be true before the SL is set. Until then the module is inactive. Without a precondition, the SL is set the moment the order opens. See Conditions.
- SL start value: the price of the SL, any value or calculation, for example
Low | S1orBid− 20 ×Pip. You build it like an Advanced Condition. - When to remove SL (optional): a condition that removes the SL again.
- SL offset (pips): moves the SL away from the SL start value, to adjust where it starts.
- Trail step size: how much the SL moves for every pip of new profit. With 1 it moves 1 pip, with 2 it moves 2 pips. With 0 the SL doesn’t trail (see the tip below).
- Trail minimum distance (pips): the SL never gets closer to the current price than this. With 0 or a negative value the SL can overtake the price, which closes the order before the price retraces.
- Close percentage: the part of the position this module closes. With 1 lot and 50, it closes 0.5 lot. A second module with 50 then closes 0.25 lot: 50% of the remaining 0.5 lot. Use 100 to close the entire position.
- Reuse module after partial close: with a Close percentage below 100, whether this module can act again on the same order when the precondition is true again.
Related
Section titled “Related”- Stop loss - Conditional: the same without a calculated value or partial close
- Take profit - Conditional (Pro): the same for take profit
- Operands: values to calculate the SL start value with
MetaTrader is a registered trademark of MetaQuotes Ltd. EA Builder Pro is not affiliated with MetaQuotes.