Early exit filter
Marks bars where price has dropped more than a set percentage below the trade's entry price.
EarlyExitFilter takes each bar's close and the trade's entry price and works out the percent change between them. It returns True when that change is below minus the stop threshold, so at the default 0.8% it flags bars where a long position is down more than 0.8% from entry. With no entry price it returns nothing, and with an entry price of zero it returns False.
How to read it
- The flag is drawn as markers on the candles only, with no line or pane.
- A marker means the close is more than the stop threshold below the entry price.
- It needs an entry price to say anything, so read it against a specific trade.
What it outputs
- Early exit
- True on bars where the close is more than the stop threshold below the entry price, otherwise False.
When it fires
Fires on each bar where the close is more than the stop threshold below entry, so a long trade has lost more than that share of its entry value. The moment marks a breached stop; markers repeat on every bar that stays past the level.
Settings
- stop_threshold
- Fall below entry needed to flag, as a fraction (0.008 is 0.8%). Lower fires sooner and more often. At 1.0 or above it never fires, since price cannot fall more than 100%. Negative values flip the test to fire unless the close is well above entry.
Pitfalls
- At the default 0.8% it never fired across the one-month SPY sample, so it is rare at default settings; the try presets loosen it.
- Entry price has no default and the sample does not record which entry it used, so a silent result may only mean no entry was wired in.
- It only flags falls, so a short position moving against you (price rising) never triggers it.