PROTECTED SOURCE SCRIPT
Power Line — Adaptive Kalman/JMA - One The Mark Trading

What this indicator does (in one line)
It plots one adaptive “Power Line” (the active slow MA for your current regime) and flips its colour when the fast crosses the slow after passing a set of precision filters (hysteresis, debounce, slope, ADX, optional HTF alignment). The script also gives you a right-side HUD with Entry / Stop / TP1–TP3 and an optional Mini Dashboard (RSI, ADX strength, candle strength).
Regimes (how the moving averages change by timeframe)
Auto by TF (default):
LTF (≤ LTF max minutes): Kalman(JMA) fast/slow (defaults 3/21). Kalman scope preset = Both (fast + slow smoothed by Kalman for low noise).
MID (≤ MID max minutes): RMA 20/50.
HTF (> MID max minutes): selectable MA 50/200 (EMA/SMA/RMA/WMA).
Manual: choose LTF / MID / HTF explicitly.
Tip: If your chart is very noisy (crypto LTF), keep LTF and leave Kalman scope = Both. For indices on 5–15m, try Fast only if you want slightly earlier flips.
Power Line & flips
The Power Line is the slow curve of your active pair (e.g., JMA 21 on LTF, RMA 50 on MID, etc.).
Green = bull, Red = bear.
A flip only registers when:
fast crosses slow beyond a buffer (flipBufATR × ATR),
the condition holds for debounceBars bars (if > 0),
the slope of the Power Line exceeds slopeMinTick,
ADX ≥ adxMin (if ADX gate on), and
HTF alignment agrees (if enabled).
This reduces tiny back-and-forth whips.
Mini Dashboard (top-right by default)
Trend: current direction (from flips).
RSI: quick read of momentum (Bullish / Neutral / Bearish).
ADX: trend strength buckets (Weak / Trending / Strong).
Candle Strength: current candle body-to-range (±100).
Move it: Settings → Mini Dashboard → Dashboard position.
Use the dashboard to validate a candidate entry (e.g., avoid shorts when RSI is deeply oversold and candle strength is strongly bullish unless you’re fading a spike).
The HUD (Entry / SL / TP1–TP3)
On every confirmed flip the script:
Sets Entry at the signal close (or at the Power Line if you switch Entry price to Basis).
Sets Stop to the internal Adaptive SuperTrend line (not plotted, but shown as a dashed HUD line).
Projects TP1/TP2/TP3 at 1R / 2R / 3R multiples of (Entry – Stop).
Options:
Ratchet entry (while the trend holds) to keep entries sensible if you build in later.
Auto BE at TP1 to move the stop to breakeven after a 1R tag.
Max entry drift (R) to clamp entries that wander too far from current price.
How to take entries (playbooks)
A) Conservative continuation (my default)
When: A fresh flip has printed (new colour), but price is extended.
How:
Wait for a pullback toward the Power Line (or toward the dashed SuperTrend HUD line).
Enter with trend on a supportive candle (e.g., bullish body for longs).
Stop: keep at the HUD Stop.
TPs: scale at TP1, move to BE (toggle on), let a runner to TP2/TP3.
Why: Pullbacks reduce chasing risk and improve RR.
B) Aggressive flip-close
When: High momentum flips with strong dashboard.
How:
Enter on the close of the confirmed flip bar.
Use the HUD Stop.
If ATR is high, consider taking a partial at 0.75–1.0R and move to BE quickly.
Why: Captures fast breaks, but only do it when ADX ≥ threshold and Candle Strength agrees.
C) Retest trigger
When: Flip is in, price retests the Power Line from the new side.
How:
Wait for a tag or small pierce of the Power Line.
Enter on the next candle closing back with trend.
Stop at HUD Stop, standard TP ladder.
Why: Elegant risk; lets the market confirm the new regime.
Using the filters (when to tighten/loosen)
Hysteresis buffer (flipBufATR):
Noisy LTF/crypto: 0.15–0.30.
Cleaner markets/HTF: 0.05–0.15.
Debounce bars (debounceBars):
0 = instant.
1–2 on LTF to avoid micro-spikes.
Slope gate:
slopeLen 5 and slopeMinTick 2 ticks are sensible.
Raise slopeMinTick if you still get sideways flips.
ADX gate:
Start with adxLen 14, adxMin 20–25.
Raise to 30 if you only want strong trends.
HTF alignment:
Enable when you want swing-style trades only with the higher-timeframe tide (e.g., trade 5m only in the direction of 1h Power Line).
Timeframe suggestions
Scalps (1–3m / 5m): LTF regime, Kalman scope = Both, buffer 0.20–0.30, debounce 1–2.
Intraday trends (5–15m / 30m): LTF or MID depending on your thresholds; ADX gate ≥ 20–25.
Swing (1h / 4h / Daily): MID/HTF; consider HTF alignment with one level above (e.g., trade 1h with 4h alignment).
Risk & trade management (simple and robust)
Risk fixed R per trade (e.g., 1% account per R).
Stop: HUD Stop (adaptive ST).
TPs:
TP1 at 1R → take 25–50% → move to BE (toggle Auto BE at TP1).
TP2 at 2R, TP3 at 3R for runners.
If volatility compresses (dashboard ADX “Weak”), either tighten or skip.
Alerts (so you don’t stare at screens)
Enable the built-in alerts:
Bullish flip and Bearish flip (they already respect your filters).
You can add alerts on price crossing TP lines if you’d like (TradingView “Add Alert on Horizontal Line”), or wire custom alerts into the script.
Tuning checklist (if you see too many whips)
Increase flipBufATR (0.2 → 0.3).
Add one more debounceBars.
Raise slopeMinTick.
Increase adxMin to 25–30.
Turn on HTF alignment.
Common pitfalls
Chasing the first flip candle in high ATR spikes without ADX/slope confirmation. Use the Retest or Conservative playbook instead.
Turning off all filters on very low timeframes. Expect noise if you do.
Ignoring the HUD Stop: it’s adaptive; don’t freehand it unless your structure stop is tighter and logical.
Quick start (TL;DR)
Keep Auto by TF on.
Use Conservative entry: wait for pullback to the Power Line after a flip.
Confirm dashboard (RSI not fighting, ADX not “Weak”, candle strength supporting).
Stop at HUD line; TP1 at 1R → BE; scale at TP2/TP3.
If you want fewer but cleaner trades, enable HTF alignment.
It plots one adaptive “Power Line” (the active slow MA for your current regime) and flips its colour when the fast crosses the slow after passing a set of precision filters (hysteresis, debounce, slope, ADX, optional HTF alignment). The script also gives you a right-side HUD with Entry / Stop / TP1–TP3 and an optional Mini Dashboard (RSI, ADX strength, candle strength).
Regimes (how the moving averages change by timeframe)
Auto by TF (default):
LTF (≤ LTF max minutes): Kalman(JMA) fast/slow (defaults 3/21). Kalman scope preset = Both (fast + slow smoothed by Kalman for low noise).
MID (≤ MID max minutes): RMA 20/50.
HTF (> MID max minutes): selectable MA 50/200 (EMA/SMA/RMA/WMA).
Manual: choose LTF / MID / HTF explicitly.
Tip: If your chart is very noisy (crypto LTF), keep LTF and leave Kalman scope = Both. For indices on 5–15m, try Fast only if you want slightly earlier flips.
Power Line & flips
The Power Line is the slow curve of your active pair (e.g., JMA 21 on LTF, RMA 50 on MID, etc.).
Green = bull, Red = bear.
A flip only registers when:
fast crosses slow beyond a buffer (flipBufATR × ATR),
the condition holds for debounceBars bars (if > 0),
the slope of the Power Line exceeds slopeMinTick,
ADX ≥ adxMin (if ADX gate on), and
HTF alignment agrees (if enabled).
This reduces tiny back-and-forth whips.
Mini Dashboard (top-right by default)
Trend: current direction (from flips).
RSI: quick read of momentum (Bullish / Neutral / Bearish).
ADX: trend strength buckets (Weak / Trending / Strong).
Candle Strength: current candle body-to-range (±100).
Move it: Settings → Mini Dashboard → Dashboard position.
Use the dashboard to validate a candidate entry (e.g., avoid shorts when RSI is deeply oversold and candle strength is strongly bullish unless you’re fading a spike).
The HUD (Entry / SL / TP1–TP3)
On every confirmed flip the script:
Sets Entry at the signal close (or at the Power Line if you switch Entry price to Basis).
Sets Stop to the internal Adaptive SuperTrend line (not plotted, but shown as a dashed HUD line).
Projects TP1/TP2/TP3 at 1R / 2R / 3R multiples of (Entry – Stop).
Options:
Ratchet entry (while the trend holds) to keep entries sensible if you build in later.
Auto BE at TP1 to move the stop to breakeven after a 1R tag.
Max entry drift (R) to clamp entries that wander too far from current price.
How to take entries (playbooks)
A) Conservative continuation (my default)
When: A fresh flip has printed (new colour), but price is extended.
How:
Wait for a pullback toward the Power Line (or toward the dashed SuperTrend HUD line).
Enter with trend on a supportive candle (e.g., bullish body for longs).
Stop: keep at the HUD Stop.
TPs: scale at TP1, move to BE (toggle on), let a runner to TP2/TP3.
Why: Pullbacks reduce chasing risk and improve RR.
B) Aggressive flip-close
When: High momentum flips with strong dashboard.
How:
Enter on the close of the confirmed flip bar.
Use the HUD Stop.
If ATR is high, consider taking a partial at 0.75–1.0R and move to BE quickly.
Why: Captures fast breaks, but only do it when ADX ≥ threshold and Candle Strength agrees.
C) Retest trigger
When: Flip is in, price retests the Power Line from the new side.
How:
Wait for a tag or small pierce of the Power Line.
Enter on the next candle closing back with trend.
Stop at HUD Stop, standard TP ladder.
Why: Elegant risk; lets the market confirm the new regime.
Using the filters (when to tighten/loosen)
Hysteresis buffer (flipBufATR):
Noisy LTF/crypto: 0.15–0.30.
Cleaner markets/HTF: 0.05–0.15.
Debounce bars (debounceBars):
0 = instant.
1–2 on LTF to avoid micro-spikes.
Slope gate:
slopeLen 5 and slopeMinTick 2 ticks are sensible.
Raise slopeMinTick if you still get sideways flips.
ADX gate:
Start with adxLen 14, adxMin 20–25.
Raise to 30 if you only want strong trends.
HTF alignment:
Enable when you want swing-style trades only with the higher-timeframe tide (e.g., trade 5m only in the direction of 1h Power Line).
Timeframe suggestions
Scalps (1–3m / 5m): LTF regime, Kalman scope = Both, buffer 0.20–0.30, debounce 1–2.
Intraday trends (5–15m / 30m): LTF or MID depending on your thresholds; ADX gate ≥ 20–25.
Swing (1h / 4h / Daily): MID/HTF; consider HTF alignment with one level above (e.g., trade 1h with 4h alignment).
Risk & trade management (simple and robust)
Risk fixed R per trade (e.g., 1% account per R).
Stop: HUD Stop (adaptive ST).
TPs:
TP1 at 1R → take 25–50% → move to BE (toggle Auto BE at TP1).
TP2 at 2R, TP3 at 3R for runners.
If volatility compresses (dashboard ADX “Weak”), either tighten or skip.
Alerts (so you don’t stare at screens)
Enable the built-in alerts:
Bullish flip and Bearish flip (they already respect your filters).
You can add alerts on price crossing TP lines if you’d like (TradingView “Add Alert on Horizontal Line”), or wire custom alerts into the script.
Tuning checklist (if you see too many whips)
Increase flipBufATR (0.2 → 0.3).
Add one more debounceBars.
Raise slopeMinTick.
Increase adxMin to 25–30.
Turn on HTF alignment.
Common pitfalls
Chasing the first flip candle in high ATR spikes without ADX/slope confirmation. Use the Retest or Conservative playbook instead.
Turning off all filters on very low timeframes. Expect noise if you do.
Ignoring the HUD Stop: it’s adaptive; don’t freehand it unless your structure stop is tighter and logical.
Quick start (TL;DR)
Keep Auto by TF on.
Use Conservative entry: wait for pullback to the Power Line after a flip.
Confirm dashboard (RSI not fighting, ADX not “Weak”, candle strength supporting).
Stop at HUD line; TP1 at 1R → BE; scale at TP2/TP3.
If you want fewer but cleaner trades, enable HTF alignment.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Możesz jednak używać go swobodnie i bez żadnych ograniczeń – więcej informacji tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.
Skrypt chroniony
Ten skrypt został opublikowany jako zamknięty kod źródłowy. Możesz jednak używać go swobodnie i bez żadnych ograniczeń – więcej informacji tutaj.
Wyłączenie odpowiedzialności
Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.