NEWCard payments are live · from $18/month, USDT also acceptedSee plans
COINPRED / STRATEGY LIBRARY

BTC HyperSAR Reactor: After a trail flip, enter only if close clears an ATR buffer and volatility is high enough; shorts also need a bearish regime by default

exlux's open-source trend script (MPL 2.0), titled "HyperSAR Reactor" in the source and "Hyper SAR Reactor Trend Strategy" on the publication page. It trails price with a PSAR-style line whose step grows with trend strength. A flip is not enough: close must clear an ATR buffer, and ATR has to be at least its average. Both sides are allowed; shorts also need a bearish regime by default. The author's chart is CRYPTO:BTCUSD, 1-hour. Rules follow the source; this page invents no backtest figures.

Illustrated guidesPine Script®Included with monthly & annual plans
← All strategies
exlux · 1.0 · 2026-12-03 · Trend following
BTC HyperSAR Reactor: After a trail flip, enter only if close clears an ATR buffer and volatility is high enough; shorts also need a bearish regime by default

The idea

This is exlux's open-source strategy. The script title is "HyperSAR Reactor" (with a trailing space); the publication page calls it "Hyper SAR Reactor Trend Strategy". It takes the usual parabolic-SAR idea and lets the acceleration factor react to trend strength: the slope of close over a window is scaled by ATR, squeezed through a sigmoid, and then used to widen the step. After the trail flips, the close still has to sit beyond the line by an ATR buffer, and current ATR has to be at least its moving average, before an order is allowed.

Longs and shorts are both on by default. Shorts also face a regime filter that is on by default: close must be below a slower EMA, and the slope of close over another window must be negative. The author's chart is CRYPTO:BTCUSD on the 1-hour, so this entry is filed under BTC. The script does not hard-code a symbol. The source exposes a "TP long ATR" input, but the matching strategy.exit is commented out, so that field does not place a take-profit order.

Author chart of exlux HyperSAR Reactor on CRYPTO:BTCUSD 1-hour
Author chart: CRYPTO:BTCUSD, 1-hour, from the script's publication page. The image shows the adaptive trail and trade markers. It is only an illustration, not a live or backtest track record.

How the lines are built

  • The trail advances like a classic SAR: along the current direction, the acceleration factor AF moves the point toward the extreme EP, and the next point is clamped by the last one or two highs or lows so it does not cut through recent price.
  • Strength is the absolute slope of close over the Strength window (default 18), divided by ATR (default 16). That ratio goes through a sigmoid (default gain 4.5, center 0.45) to get a strength value around 0 to 1.
  • The dynamic step is Base step (default 0.04) plus Boost factor (default 0.03) times strength. When a new extreme is made, AF eases toward min(current AF + step, Max AF) with AF smoothing (default 0.50). Max AF defaults to 1.00, much more aggressive than the textbook 0.20.
  • The trail itself has Trail smoothing (default 0.35): it takes a midpoint between the old and new points, then only allows the line to move in the trend direction.
  • A flip happens when close crosses the next SAR point. On a flip, the trail jumps to the previous EP, the new EP is this bar's high or low, and AF resets to Start AF (default 0.02). vis_psar is for display only; orders use the internal psar.
  • The volatility gate vol_ok requires current ATR divided by its average (default 30) to be at least the Vol gate ratio (default 1.00).
  • The bearish regime bias_dn is close below the Bias MA (default 91-period EMA) and a negative slope of close over the Bear bias window (default 54).

Entry rules

  • Both sides are allowed by default. An entry is considered only on the bar where the trail just flipped.
  • A long needs a flip to an uptrend, close above the trail plus Flip confirm buffer ATR (default 0.50) times ATR, a passing volatility gate, and no cooldown.
  • A short needs a flip to a downtrend, close below the trail minus the same ATR buffer, a passing volatility gate, and no cooldown. If Gate shorts by bear regime is on (the default), the bearish regime above must also be true.
  • Cooldown bars after entry defaults to 0, so there is no extra wait. After a fill, the source sets the next allowed bar to the current bar_index plus that cooldown.

Exits and position size

  • The long strategy.exit that would use the trail as a stop and TP long ATR as a target is commented out. The default 1.0 TP long ATR therefore does not place a take-profit, and longs do not get that stop order.
  • A long is mainly flattened by strategy.close("Long") when a short signal passes. If shorts are allowed, a short entry can also reverse the long (pyramiding is 0).
  • Shorts do call strategy.exit: the stop is the current trail, and a limit is attached only when TP short ATR is greater than 0. That input defaults to 0.0, so shorts have no fixed target by default. They rely on the trail stop, or on a passing long signal.
  • The tester sizes at 100% of equity, with 0.05% commission and 5 ticks of slippage. margin_long and margin_short are both set to 0 in the source. Those settings apply to the tester only, not to live routing.

Inputs (defaults in the source)

InputDefaultWhat it does
Start AF / Max AF / Base step0.02 / 1.00 / 0.04Starting acceleration, its cap, and the base step.
Strength window / ATR length18 / 16Lookbacks for the slope strength and ATR.
Strength gain / center / Boost factor4.5 / 0.45 / 0.03Squash slope strength toward 0–1 and add it to the step.
AF smoothing / Trail smoothing0.50 / 0.35Inertia on the acceleration factor and on the trail.
Allow Long / Allow Shorttrue / trueWhether new longs or shorts are permitted.
Flip confirm buffer ATR0.50Extra ATR distance close must clear after a flip.
Cooldown bars after entry0Bars to wait after an entry before the next one.
Vol gate length / ratio30 / 1.00Minimum ATR relative to its average.
Gate shorts by bear regimetrueShorts also need the bearish regime.
Bear bias window / Bias MA length54 / 91Slope window and EMA used for that regime.
TP long ATR / TP short ATR1.0 / 0.0Nominal ATR targets. The long exit is commented out; the short default of 0 places no limit.

Caveats

  • Longs are not protected by a trail stop order. If a flip against the long fails the volatility or bear-regime filter, the long can stay open until a later signal actually passes.
  • TP long ATR appears in the inputs but does not place an order. Do not read it as an active long take-profit.
  • Max AF defaults to 1.00, so the trail can hug price quickly and flips can be more frequent than with a classic SAR.
  • CRYPTO:BTCUSD is TradingView's synthetic index and will not match a single exchange's spot or perp feed tick for tick.
  • process_orders_on_close is false, so the tester may fill before a bar closes. That is a different assumption from evaluating only on the close.

Install it on TradingView

  1. Download the .pine file from Coinpred (a current membership is required; see the page) or check the original publication for a newer revision.
  2. Open the symbol and timeframe you want in TradingView, open the Pine Editor, paste the source, and add it to the chart.
  3. Start with the defaults so you can see the flips, the ATR buffer, and the short-side regime filter, then change the buffer, volatility gate, and whether shorts are allowed for your market and timeframe.
  4. The order size, capital, commission, and slippage in the source apply to the strategy tester only. Live order routing has to be set separately.
  5. Crypto trades around the clock. The tester's timezone and session settings may differ from your venue by several hours.

About backtest figures

Source, license, and version

  • Source: https://www.tradingview.com/script/JNTdgnin-Hyper-SAR-Reactor-Trend-Strategy/
  • Author: exlux (header © exlux)
  • License: Mozilla Public License 2.0. Redistribution must keep the original copyright and license notices; if you modify the source file, the modified file must remain under MPL 2.0. Coinpred ships the unmodified source.
  • Version: 1.0 in the publication record and pine-facade. scriptAccess is open_no_auth.

Source, license and version

Licensed under MPL 2.0 per the source header, © exlux. Redistribution must keep the copyright and license notices; modified files must remain under MPL 2.0. Coinpred ships the unmodified source.

View original source ↗

Check the script license and your TradingView account features. Historical results do not guarantee future performance.

Related strategies

All strategies →