Exit Long¶
EA · Exits
When true, close any open long positions. Wire into EAOutput.exit_long.
Exit Long marks a condition that closes any open long position in an exported / live strategy. When the boolean you wire in is true, longs are closed — regardless of where price sits relative to stop or target. It's how you build signal-based exits: getting out because momentum rolled over, the session ended, or structure broke, rather than because a fixed price was hit.
How it works¶
It's a pass-through: one signal In, the same signal Out, wired into the EA Output's long-exit socket. It tags the signal's role as "close longs." Price-based exits (stop-loss, take-profit) don't go through here — those ride in as risk legs (Fixed Stop-Loss, Reward-to-Risk Target); Exit Long is specifically for the conditional, not-a-price-level exits. (On the chart, the equivalent is the Tester's Exit Long socket, where such exits fill at the next bar's open and a stop/target still wins ties.)
When to use it¶
Use Exit Long for exits driven by a condition rather than a level: an RSI crossing back down out of overbought, a Crosses Below of a trend line, a time-of-day flag, a Market Structure shift against you. Combine several reasons-to-leave with an Or gate so the position closes on whichever fires first. It complements your stop and target — use it for the discretionary "the reason I'm in this trade is gone" exits.
Example¶
Momentum exit: feed an RSI line into a Crosses Below against a Constant of 70, wire that into Exit Long, and route it to the EA Output's long-exit socket — so longs close when momentum fades, even before the target. Backtest the equivalent on the chart via the Tester's Exit Long socket.
Tips & gotchas¶
- For condition-based exits, not price levels — stops/targets ride in as risk legs instead.
- Combine reasons with Or — close on whichever exit condition fires first.
- A price stop/target still wins ties in the engine — signal exits are the lower-priority path.
- Mirror is Exit Short for closing shorts.
Related blocks¶
Inputs¶
| Socket | Type | What to wire in |
|---|---|---|
| In | signal |
Entry/exit trigger |
Outputs¶
| Output | Type | Plots as | Description |
|---|---|---|---|
| Out | signal |
— | Pass-through signal |
Reference auto-generated from the block catalog · category EA.