Entries get the attention, but the stop and target decide how much each trade risks and earns. You will learn to compute exits from recent swing points or ATR and to feed several of them into the Trade entry node.
How exits enter the graph
The Trade entry node has an Entry Price input and named exit inputs: stop losses SL1, SL2 and so on, and take profits TP1, TP2 and so on. Each named input takes a price, not a distance, and each connected exit is recorded when Trigger is true. You can add more of either kind from the node itself.
So the job of the graph is to produce a price for every exit. For a long trade the stop price must be below the entry and the target above it. For a short trade (direction set to sell) it is the reverse.
A swing-low stop
A swing-low stop sits just below a recent low, on the idea that if price falls beneath it, the trade idea is wrong. To find the lowest low of the last N candles, use memory nodes. SlidingWindow takes a Value and outputs Values, the last N values, with N set as its period. Min reads those Values and outputs the smallest in Min, with its Position in the window as a second output.
- Connect
Data.Lowto theValueinput of aSlidingWindownode and set its period, for example 10. - Connect
Valuesto aMinnode. ItsMinoutput is the lowest low in the window. - Optionally add a
Subtractnode to place the stop a small buffer below it, withMinonAand a number constant onB. - Connect the result to
SL1. UseMaxoverData.Highinstead for a short trade.
Worked example
A swing-low stop with a buffer and a 2R target
- The last ten lows are 98.40, 98.90, 98.10, 99.00, 99.30, 98.70, 99.50, 99.80, 99.20 and 99.60. The smallest is 98.10.
- With a buffer of 0.10, the stop is 98.10 − 0.10 = 98.00.
- With an entry at 100.40, the risk is 100.40 − 98.00 = 2.40.
- A 2R target is 100.40 + 2 × 2.40 = 100.40 + 4.80 = 105.20.
Entry 100.40, stop 98.00, target 105.20: the stop distance follows the market's structure instead of being fixed.
Check in the replay whether the window includes the current candle, because that decides whether the stop can ever equal the candle's own low. A very distant swing low also gives a wide stop and, with fixed risk, a small position.
ATR stops and several exits
An ATR stop, as in the previous lesson, uses Subtract of the close and Multiply of the ATR by a multiple such as 1.5. Its advantage over a swing stop is that it is always defined and scales with volatility. Its drawback is that it ignores where the market's structure actually lies.
Adding SL2 or TP2 lets you connect a second price, for example a nearer target at 1R in TP1 and a further one at 2R in TP2, or a swing stop alongside an ATR stop. How the exits are combined in a trade, and which one is hit first, should be verified in the replay for your own graph rather than assumed.
| Method | Nodes | Adapts to |
|---|---|---|
| Fixed distance | Subtract close and a number constant | Nothing |
| ATR multiple | ATR, Multiply, Subtract | Volatility |
| Swing low | SlidingWindow, Min, Subtract | Recent structure |
Key takeaways
- Each exit input of
Trade entrytakes a price:SL1,SL2for stops andTP1,TP2for targets. - A swing-low stop is
SlidingWindowoverLowintoMin, optionally with a small buffer subtracted. - An ATR stop adapts to volatility, while a swing stop follows structure, and each has different weaknesses.
- Whenever you build exits, inspect the actual prices of trades in the replay.