Trade System Exits

All pre-defined exits are customizable.

Exit name

Money management (SL)

Order type

Stop

Description

Maximum acceptable loss per trade (classic stop loss).

Parameter

Amount of money for stop to be activated.

Code (price)

OpenPositionAverageEntryPrice(@,ThisTradeOnly) - Dollar2Price(@,1000) / OpenPositionEntrySize(@,ThisTradeOnly)

 

      Customization example: replace $1000 with MM

Using MM instead of an amount makes it possible to change this value from a chart (parameters), which makes it easy to experiment with stop loss settings.

OpenPositionAverageEntryPrice(@,ThisTradeOnly) - Dollar2Price(@,MM) / OpenPositionEntrySize(@,ThisTradeOnly)

      Customization example: replace $1000 with MM2

You can also change the amount by using a variable. Add the variable to the code.

MM2= ATR(@,Smo, 10)

OpenPositionAverageEntryPrice(@,ThisTradeOnly) - Dollar2Price(@,MM2) / OpenPositionEntrySize(@,ThisTradeOnly)

 

Exit Name

Break even (BE)

Order type

Stop

Description

Profit level for the stop to be activated.

Once the profit level is reached, the stop order is activated at the entry price. In this way, the trade is break even (floor is reached).

Parameter

Amount of money for floor to be activated.

Code (signal)

BarsSinceEntry(@,0,OldestOpen,ThisTradeOnly) > 0 AND MaxPer(OpenPositionProfit(@,ThisTradeOnly)[-1],BarsSinceEntry(@,0,OldestOpen,ThisTradeOnly)) >= 1000

 

Exit Name

Dollar risk trailing (DRT)

Order type

Stop

Description

Amount of the open position profit that the trader is prepared to forego (based on close).

Because it is a trailing stop, as open position profits increase, the stop also increases.

Parameter

Amount of money from best close that triggers exit.

Code (price)

(Close(@)[-1] when (OpenPositionProfit(@,ThisTradeOnly)[-1] = MaxPer(OpenPositionProfit(@,ThisTradeOnly)[-1],BarsSinceEntry(@,0,OldestOpen,ThisTradeOnly)))) - Dollar2Price(@,1000) / OpenPositionEntrySize(@,ThisTradeOnly)

 

Exit Name

Percent risk trailing (PRT)

Order type

Stop

Description

Similar to DRT, but based on percentage.

Minimum level of profit (floor) that activates the stop order and the retracement percentage level to set the stop.

For example, with the default parameters of $1000 and 50%: the stop is activated once profits reach $1000, and the stop is set at 50% of that level ($500).

Parameter

Amount of money for floor to be activated.

Percentage willing to give up.

Code (price)

((1 - 50 / 100) * (Close(@)[-1] when (OpenPositionProfit(@,ThisTradeOnly)[-1] = MaxPer(OpenPositionProfit(@,ThisTradeOnly)[-1],BarsSinceEntry(@,0,OldestOpen,ThisTradeOnly)))) + (50 / 100) * AverageEntryPrice(@,ThisTradeOnly))

 

Exit Name

Profit target (PT)

Order type

Limit

Description

Profit amount.

Parameter

Target amount to win per trade.

Code (price)

OpenPositionAverageEntryPrice(@,ThisTradeOnly) + Dollar2Price(@,1000) / OpenPositionEntrySize(@,ThisTradeOnly)

 

      Customization example: replace $1000 with Rang variable

Rang is defined as the thirteen period exponential moving average of custom study OCRange divided by the three period volatility and multiplied by a parameter MF. OCRange measures the absolute value of the open to close range of a price bar.

Rang := MA(OCRange.c1^@), Exp, 13.000/Volat(@,3)*MF;

OpenPositionAverageEntryPrice(@,ThisTradeOnly) + Dollar2Price(@,Rang) / OpenPositionEntrySize(@,ThisTradeOnly)

 

Exit Name

Entry stop (ES)

Order type

Stop

Description

Places stop on the high or low of the entry bar.

Parameter

High and Low

Code (price)

High(@) when BarsSinceEntry(@,0,All,ThisTradeOnly) = 0