Pine Script® strategy
Indicators and strategies
EMA + Ichimoku Base Strategy with RSI ZonesStrategy Overview
Name: EMA + Ichimoku Base Strategy with RSI Zones
Script Type: TradingView Strategy (Pine Script v6)
Market Style: Trend-following with RSI zone signals
Trade Direction: Both Long and Short
Pyramiding: Up to 10 positions allowed
The strategy combines 4 indicators:
EMA (4) → Entry trigger
Ichimoku Base Line (Kijun-sen 10) → Stop loss level
RSI (7) → Momentum zones
WMA of RSI (5) → RSI smoothing
Pine Script® strategy
Machine Learning - Lorentzian KNN Classifier (Update)══════════════════════════════════════════
TRADINGVIEW DESCRIPTION
══════════════════════════════════════════
SHORT DESCRIPTION:
Non-repainting ML classifier using Lorentzian distance metric with 4-feature KNN, kernel regression envelope, multi-layer confluence scoring, and AI Trade Quality Grade. Updated v2.0.
══════════════════════════════════════════
FULL DESCRIPTION:
══════════════════════════════════════════
█ UPDATE v2.0 — CRITICAL IMPROVEMENTS
This is a major update to the Lorentzian KNN Classifier strategy. The previous version contained a repainting issue that inflated backtest results. This has been fully resolved:
✦ calc_on_every_tick disabled — all calculations on confirmed (closed) bars only
✦ Entry conditions gated by barstate.isconfirmed — no mid-bar decisions
✦ Trailing stop values properly converted to ticks via syminfo.mintick
✦ Backtest results now reflect realistic, achievable performance
If you were using the previous version, please update immediately. Live trading results will now match what the backtest shows.
█ WHAT IS THIS?
A machine learning classification strategy that uses the Lorentzian distance metric — a non-Euclidean measure better suited for financial time series than traditional Euclidean distance. The classifier analyzes 4 normalized features across a sliding training window and predicts short-term price direction using inverse-distance-weighted K-Nearest Neighbors voting.
█ HOW THE KNN CLASSIFIER WORKS
The Lorentzian distance between two points is calculated as:
d(x, y) = Σ log(1 + |xᵢ − yᵢ|)
Unlike Euclidean distance, Lorentzian distance is less sensitive to outliers in individual features — a property that makes it more robust for noisy financial data.
The classifier uses 4 features, each z-score normalized over 50 bars:
• RSI (default 14) — momentum oscillator
• WaveTrend (LazyBear, channel 10, average 21) — cycle detection
• CCI (default 20) — mean reversion pressure
• ADX (default 14) — trend strength
For each bar, the algorithm scans a training window (default 50 bars back) and computes the Lorentzian distance to every historical bar. Each neighbor casts a weighted vote (weight = 1/distance) based on its 5-bar forward return label. The aggregate bull vs bear vote produces a score smoothed by EMA(3).
KNN Score > +0.1 → BULL classification
KNN Score < −0.1 → BEAR classification
Otherwise → NEUTRAL
█ NEW: AI TRADE QUALITY GRADE
Every signal receives a letter grade from A+ to F, calculated from three components:
• KNN Confidence (40%) — how decisive the classifier vote was
• Confluence Score (35%) — how many independent filters agree (MTF, Ribbon, Order Flow, Smart Money, ADX)
• Regime Fitness (25%) — whether market conditions match the strategy type (trending market + trend signal = high fitness)
Grade interpretation:
A+ / A → High-conviction setup, all systems aligned
B → Good setup, minor disagreements
C → Marginal, proceed with caution
D / F → Weak setup, consider skipping
The grade appears on entry labels ("BUY A+", "SELL B") and in alert messages, giving you an instant read on trade quality without analyzing the dashboard.
█ MULTI-LAYER CONFLUENCE ENGINE
The strategy combines 3 entry types with 5 institutional-grade filters:
Entry Types:
• Trend Following — EMA 21/50 crossover + EMA 200 direction + volume spike
• Breakout — Donchian channel break + volume confirmation
• Mean Reversion — Bollinger Band extreme + RSI reversal (ranging markets only)
Filters (each independently toggleable):
• MTF Filter — higher timeframe EMA alignment (default 4H)
• MA Ribbon — 8-layer Fibonacci ribbon (8/13/21/34/55/89/144/233) with alignment threshold
• Order Flow — VWAP position + CVD divergence + volume delta analysis
• Smart Money Concepts — Order blocks, fair value gaps, liquidity sweeps, BOS/CHoCH, demand/supply zones
• Volatility Regime — Bollinger Band width expansion/contraction + ATR percentile ranking
Confluence score: 0–5.55 (5 base filters + KNN weight 0.55)
█ KERNEL REGRESSION ENVELOPE
Visual overlay showing an EMA-based kernel center with ATR-scaled bands (±0.5σ to ±3σ). Green gradient above center, red gradient below. Provides instant visual context for where price sits relative to the statistical envelope.
█ RISK MANAGEMENT
• ATR-based stop loss (default 2.0x ATR)
• ATR-based take profit (default 3.0x ATR)
• Optional trailing stop (default 1.5x ATR activation)
• Session time filter
• All values properly tick-normalized for accurate backtesting
█ DASHBOARD
Light-themed panel (bottom-right) showing:
• AI Trade Quality Grade (prominent, color-coded)
• KNN classification + confidence %
• Feature values (RSI/WT/CCI/ADX)
• Win rate, profit factor, R:R ratio
• Multi-timeframe trend alignment (15m/1h/4h)
• Ribbon, Smart Money, Volatility status
• Volume pressure analysis
• Demand/Supply zone count
• Current session indicator
• Active signal with SL/TP levels
█ USAGE NOTES
• Works on any instrument and timeframe
• Best results on 15m–4H for intraday/swing trading
• All filters can be individually enabled/disabled
• KNN lookback window (20–100) trades off speed vs accuracy
• Gradient candle coloring provides additional visual momentum context
• The strategy does NOT repaint — what you see in backtest is what you get live
█ CHANGELOG
v2.0 (current):
— Fixed repainting: calc_on_every_tick=false + barstate.isconfirmed gate
— Fixed trailing stop tick conversion (/ syminfo.mintick)
— Added AI Trade Quality Grade (A+/A/B/C/D/F)
— Light dashboard theme, repositioned to bottom-right
— Compact layout (18 rows vs 22)
— Grade shown on entry labels and alerts
— barstate.islast → barstate.islastconfirmedhistory for dashboard
v1.0:
— Initial release with Lorentzian KNN, kernel envelope, SMC, order flow
Pine Script® strategy
BTC/USD Quant Trend Engine Long Only v2 - 2x leverageA long-only trend strategy that buys strength and trails winners. High CAGR, low max drawdown
Pine Script® strategy
WJ BUY Strategy
The WJ BUY Strategy is an advanced, dual-engine systematic trading system designed to safely navigate extreme market volatility. It combines deep mean-reversion tactics (Strategy B) with disciplined trend-following accumulation (Strategy A). Instead of relying on a single entry, this hybrid system identifies extreme "exhaustion points" to establish a core position at the bottom, and then strategically scales in (pyramids) only when the upward trend is mathematically confirmed.
This strategy aggregates insights from three different dimensions of market analysis to form a holistic "WJ Score":
-Volatility Analysis (Bollinger Bands): Identifies price extremes and potential reversal zones when the asset deviates significantly from its mean.
-Trend Context (Multiple Moving Averages): Analyzes the long-term structural health using 120, 240, and 400-period MAs to determine the depth of the correction.
-Momentum Analysis (Relative Strength Index): Uses granular RSI tiers (<=25, 30, 35, 40) to detect severe oversold conditions that are often invisible on the price chart alone.
The core objective of the WJ Strategy A+B Hybrid is Risk-Adjusted Accumulation and Capital Preservation. It operates through a dynamic multi-phase process:
-Phase 1: Detection (Scoring): The system continuously calculates the WJ Score. A score >=3.0 triggers the deep-reversion "B-Mode", while a score >=2.0 triggers the trend-continuation "A-Mode".
-Phase 2: Stabilization: To avoid "falling knives," the strategy requires the score to drop and stabilize for a set number of days.
-Phase 3: Dynamic Execution: Entries are only executed when the price reclaims the short-term 10-day Moving Average, with dynamic safety filters applied based on recent price action.
This updated version introduces several proprietary risk-management mechanisms:
-Smart Trend Confirmation (Price Filter): Strategy A (scaling-in) is strictly permitted only if the current price is higher than the core Strategy B entry. This prevents averaging down in a prolonged bear market and ensures capital is only added to confirmed uptrends.
-Time-Based Cooldown (Whipsaw Protection): Implements a strict 14-day lock period after a Strategy B entry. This prevents premature accumulation during choppy, sideways market recoveries.
-Dynamic Anti-Falling-Knife Filter (MA Holding): The entry requirement dynamically adapts based on the sequence of trades. If the system is forced to average down (current price < last buy price), it demands 2 to 3 consecutive days of holding above the 10-day MA to confirm a solid floor. If buying in an uptrend, a standard 1-day breakout is sufficient.
-Dual-Engine Logic: Seamlessly transitions between catching market crashes and riding the subsequent recovery waves.
-Dynamic Scoring: Removes emotional bias by relying on an objective, unified data-driven threshold.
-High-Volatility Optimization: Specifically tuned for high-beta environments. It excels at capturing rapid price reversals where standard models are too slow to react.
The new WJ BUY Strategy(A+B Hybrid) is ideal for quantitative investors looking to systematically accumulate high-quality, volatile assets (such as US Technology, Biotechnology, or small-cap indices) during sharp pullbacks. By strictly controlling when and how to scale in, it maximizes upside potential while rigorously defending against prolonged downtrends.
Disclaimer
Trading involves significant risk. The WJ Strategy A+B Hybrid and its associated indicators are provided for educational and informational purposes only. They do not constitute financial, investment, or trading advice. Past performance is not indicative of future results. Volatile market conditions carry a higher risk of capital loss. Always perform your own due diligence and consult with a professional financial advisor before making any investment decisions.
Pine Script® strategy
BTC/USD Quant Scoring System Long OnlyLong only, High cagr low risk trading system. Can be scaled using leverage and reach cagr up to around 90-100%
Pine Script® strategy
Anti- Equal prices ATRThis strategy identifies equal highs and equal lows - horizontal price levels where multiple swing points cluster within a defined tolerance. These levels represent liquidity pools where stop losses accumulate, making them prime areas for reversals.
How It Works
Equal Highs Detection:
Scans the lookback period for the highest high
Counts how many bars have highs within the tolerance of that level
If 2+ touches exist, an "equal highs" zone is confirmed
Equal Lows Detection:
Scans the lookback period for the lowest low
Counts how many bars have lows within the tolerance of that level
If 2+ touches exist, an "equal lows" zone is confirmed
Entry Logic:
Short Entry: When equal highs exist AND current bar touches/reaches that level
Long Entry: When equal lows exist AND current bar touches/reaches that level
Exit Logic (ATR-Based):
Stop Loss: ATR × Stop Multiplier (default 1.5)
Take Profit: ATR × Target Multiplier (default 2.5)
Settings
Parameter Default Description
Lookback Bars 30 Period to scan for equal levels
Tolerance 5.0 Points within which highs/lows are considered "equal"
ATR Length 14 ATR calculation period
ATR Stop Mult 1.5 Stop distance = ATR × this value
ATR Target Mult 2.5 Target distance = ATR × this value
Session 0830-1500 Trading hours filter
Best Used On
NQ, ES, and other index futures
1-minute to 15-minute timeframes
High-volume sessions (US market hours)
Pine Script® strategy
VWAP Strategy This strategy is designed for intraday futures trading around the NYSE open VWAP. It identifies long and short opportunities when price reclaims the New York VWAP, pulls back to hold it, and aligns with 5/8/13 EMA trend confirmation. The script also includes an 18:00–16:00 anchored VWAP for added context, a previous day VWAP, and a VWAP cross tracking to help filter out choppy conditions, and configurable hold markers, cross markers, stop limits, and profit targets.
In addition, the strategy includes a compact market-status panel that lets the trader monitor whether NQ and YM are trading above or below their own NY VWAP, 18:00 VWAP, and previous day VWAP in real time. This can help provide intermarket context while trading ES and improve confidence in directional bias and market participation.
Pine Script® strategy
Scalping Strategy Improved v2Esta estrategia da mucha rentabilidad, integra muchos indicadores y medias moviles
Pine Script® strategy
Smart Scalping PRO StrategyEsta estrategia se basa en varios indicadores institucionales y muy mejorada
Pine Script® strategy
PRO Scalping Strategy EMA50 + RSI3 + ADX5Consiste en unir varios indicadores como rsi adx y ema50 para hacer scalping
Pine Script® strategy
Greer Leap - Self-Optimizing XGBoost Approx & Statsusing the XGBoost for the competition as a test.
Only a test for the Leap competition
Pine Script® strategy
WLD 4H Auto Entry ConfirmedUT bot, MACD and EMA confirmation strategy. This a strategy for 4H timeframe, confimring when to go in a short/long and where to take TP/SL based on ATR levels
Pine Script® strategy
EMA and Dow Theory Strategies V4━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Overview
EMA and Dow Theory Strategies V4 is a refinement of V3, focused on one core problem: protecting profits on trades that moved in your favor but reversed before reaching the take-profit levels.
The entry logic is unchanged from V3 — EMA slope direction, Dow Theory swing structure, and ADX trend filter. V4 adds a Break Even Stop mechanism that automatically moves the stop-loss to the entry price once floating profit reaches a defined threshold. This single addition meaningfully improves the risk-adjusted performance without sacrificing the strategy's core edge.
The visual interface has also been fully redesigned — gradient Dow Theory zones, a neon EMA glow effect, minimal trade labels, and a real-time status table showing all entry conditions at a glance.
──────────────────────────────
What Changed from V3
Added:
- Break Even Stop (BE Stop) — When floating profit reaches the BE Trigger % threshold, the stop-loss automatically moves to entry price (+ 0.1% buffer for fees). Trades that previously resulted in a loss after being in profit now exit at breakeven instead.
- Real-time Status Table — Displays EMA direction, Dow Theory trend, ADX value, position status, and BE state. Supports Japanese / English toggle.
- Per-element display toggles — Each visual element can be shown or hidden independently via checkboxes.
- Higher TF swing repainting fix — Rebuilt using lookahead_off and confirmed pivot bars to reduce repainting. Note: the higher timeframe swing lines have always been display-only and were never used in entry conditions, so this change does not affect strategy logic.
- Bilingual support — Full Japanese / English language toggle.
Redesigned:
- EMA line now uses a 3-layer glow effect (neon teal / neon red)
- Dow Theory gradient zones simplified from 5 layers to 2 layers
- TP lines changed to semi-transparent lines (TP1 faint → TP3 visible)
- Trade labels now show only final exit results
- Higher TF swing lines thinned and made semi-transparent as reference-only
──────────────────────────────
Parameters & Recommended Ranges
EMA Period — Default: 58 — Range: 30–100
Shorter for high-volatility assets, longer for stable ones.
ATR Factor — Default: 3.8 — Range: 2.5–6.0
Controls TP distance. Higher = wider targets.
Stop Loss (%) — Default: -5.0 — Range: -4 to -10
Wider for volatile assets, tighter for BTC/ETH.
ADX Threshold — Default: 20.5 — Range: 15–28
Higher = stricter range filter, fewer but higher-quality trades.
Swing Length — Default: 13 — Range: 2–20
Larger = less sensitive to minor swings.
BE Trigger (%) — Default: 9.0 — Range: 3.0–15.0
Set below TP1 distance for protection before TP1 is reached.
──────────────────────────────
Recommended Settings by Asset Type
Meme coins (DOGE, SHIB, etc.)
EMA: 44–58 / ATR: 3.5–5.0 / SL: -5 to -8% / ADX: 18–22 / Swing: 10–15 / BE: 7–10%
Major assets (BTC, ETH)
EMA: 55–80 / ATR: 2.5–4.0 / SL: -4 to -6% / ADX: 20–25 / Swing: 8–15 / BE: 5–8%
Mid-cap alts (SOL, SUI, etc.)
EMA: 35–55 / ATR: 4.0–5.5 / SL: -5 to -7% / ADX: 18–23 / Swing: 8–15 / BE: 6–10%
Small-cap alts
EMA: 30–50 / ATR: 4.5–6.0 / SL: -7 to -10% / ADX: 18–22 / Swing: 5–12 / BE: 8–12%
──────────────────────────────
Recommended Settings by Timeframe
1–5 min: ADX threshold 15–20
15 min – 1 hour: ADX threshold 18–23
2–4 hour: ADX threshold 20–25 (default settings optimized for 2H)
──────────────────────────────
Entry Conditions
Long: EMA slope rising AND Dow Theory trend up AND ADX > threshold
Short: EMA slope falling AND Dow Theory trend down AND ADX > threshold
──────────────────────────────
Exit Conditions
TP1: Entry + ATR x Factor x 1 → close 30%
TP2: Entry + ATR x Factor x 2 → close 30%
TP3: Entry + ATR x Factor x 3 → close 30%
Stop Loss: Fixed % from entry → full close
Break Even Stop: Triggered once profit >= BE Trigger % → full close at entry price
Trend Reversal: Dow Theory swing flip → full close
──────────────────────────────
Visual Features
EMA line: 3-layer neon glow — teal when rising, red when falling
Dow Theory zones: 2-layer gradient from swing high/low to current price
Swing lines: Horizontal support/resistance at current swing high/low
TP lines: Semi-transparent lines, TP1 faint to TP3 visible
BE Stop line: Gold line shown when BE is active
Higher TF swing: Thin reference lines from the 4H timeframe
Gray background: ADX below threshold (range-bound zone, no entries)
Status Table: Real-time display of all entry conditions and current state
This strategy is designed for trend-following on crypto assets, primarily on the 1H–4H timeframe. Default settings are optimized for DOGE on the 2H chart. Always backtest on your target asset before live trading. Past performance does not guarantee future results.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
概要
EMA and Dow Theory Strategies V4 は、V3をベースに改良したバージョンです。解決した課題は一つ——含み益が出ていたにもかかわらず、TP到達前に相場が反転して損失になるトレードを減らすことです。
エントリーロジックはV3から変わっていません。EMAの傾き、ダウ理論のスイング構造、ADXトレンドフィルターの3条件です。V4ではこれにブレークイーブンストップを追加しました。含み益が設定したしきい値%に達すると、損切りラインが自動的にエントリー価格に移動します。このシンプルな追加一つで、ストラテジーの本質的なエッジを損なわずにリスク調整後のパフォーマンスが改善されています。
また、チャートの視覚表現も全面的に刷新しました。ダウ理論ゾーンのグラデーション、EMAのネオングロー効果、すっきりしたトレードラベル、そしてエントリー条件をひと目で確認できるステータステーブルを追加しています。
──────────────────────────────
V3からの主な変更点
追加したもの:
- ブレークイーブンストップ(BE Stop) — 含み益がBE発動しきい値%に達すると、損切りラインがエントリー価格(+手数料分0.1%バッファ)に自動移動。以前は「プラスになったのに最終的にマイナス」で終わっていたトレードがブレークイーブン撤退になります。
- ステータステーブル — EMA方向・ダウ理論トレンド・ADX値・ポジション状態・BEの状態をリアルタイムで一覧表示。日本語・英語の切り替えに対応。
- 描画要素の個別ON/OFF — 各表示要素をチェックボックスで個別に切り替え可能。
- 上位足スイングラインの再描画修正 — lookahead_off と確定済みピボットバーを使用して再描画を低減。なお、上位足スイングラインはもともとエントリー条件には使用しておらず、あくまで参考表示のみです。この修正はストラテジーのロジックに影響しません。
- 日英バイリンガル対応 — ステータステーブルと表示ラベルの日本語・英語切り替えに対応。
刷新したもの:
- EMAラインが3層グロー効果(ネオンティール / ネオンレッド)に
- ダウ理論グラデーションゾーンを5層→2層に簡略化
- TPラインを半透明ラインに変更(TP1が最も薄く、TP3が最も濃い)
- トレードラベルは最終決済時のみ表示(部分利確のラベルは非表示)
- 上位足スイングラインを細く・半透明にして参考表示に
──────────────────────────────
パラメーターと推奨設定範囲
EMA期間 — デフォルト: 58 — 推奨範囲: 30〜100
ボラが高い銘柄は短め、安定銘柄は長め。
ATR倍率 — デフォルト: 3.8 — 推奨範囲: 2.5〜6.0
TP距離の基準。大きいほど利確ラインが遠くなる。
損切り(%) — デフォルト: -5.0 — 推奨範囲: -4〜-10
ボラが高い銘柄は広め、BTC/ETHはタイトでOK。
ADXしきい値 — デフォルト: 20.5 — 推奨範囲: 15〜28
高いほどレンジ除外が厳しく、トレード数が減り精度が上がる。
スイング検出期間 — デフォルト: 13 — 推奨範囲: 2〜20
大きいほど小さなスイングに反応しにくくなる。
BE発動しきい値(%) — デフォルト: 9.0 — 推奨範囲: 3.0〜15.0
TP1到達距離より低めに設定すると、TP1到達前に元本を守れる。
──────────────────────────────
銘柄タイプ別おすすめ設定
ミーム系(DOGE・SHIBなど)
EMA: 44〜58 / ATR倍率: 3.5〜5.0 / 損切り: -5〜-8% / ADX: 18〜22 / スイング: 10〜15 / BE: 7〜10%
主要銘柄(BTC・ETH)
EMA: 55〜80 / ATR倍率: 2.5〜4.0 / 損切り: -4〜-6% / ADX: 20〜25 / スイング: 8〜15 / BE: 5〜8%
中堅アルト(SOL・SUIなど)
EMA: 35〜55 / ATR倍率: 4.0〜5.5 / 損切り: -5〜-7% / ADX: 18〜23 / スイング: 8〜15 / BE: 6〜10%
小型アルト
EMA: 30〜50 / ATR倍率: 4.5〜6.0 / 損切り: -7〜-10% / ADX: 18〜22 / スイング: 5〜12 / BE: 8〜12%
──────────────────────────────
時間足別おすすめ設定
1〜5分足: ADXしきい値 15〜20
15分〜1時間足: ADXしきい値 18〜23
2〜4時間足: ADXしきい値 20〜25(デフォルト設定は2時間足向けに最適化)
──────────────────────────────
エントリー条件
ロング: EMAが上向き AND ダウ理論トレンドが上昇 AND ADX > しきい値
ショート: EMAが下向き AND ダウ理論トレンドが下降 AND ADX > しきい値
──────────────────────────────
イグジット条件
TP1: エントリーから +ATR×倍率×1 → 30%決済
TP2: エントリーから +ATR×倍率×2 → 30%決済
TP3: エントリーから +ATR×倍率×3 → 30%決済
損切り: 設定%を超えたら全決済
BEストップ: 含み益がBE発動しきい値%以上になると自動発動 → エントリー価格で全決済
トレンド反転: ダウ理論のスイングが逆転したら全決済
──────────────────────────────
チャートの見方
EMAライン: 3層グローエフェクト。上向きのときネオンティール、下向きのときネオンレッド
ダウ理論ゾーン: スイング高値・安値から現在価格までの2層グラデーション
スイングライン: 現在のサポート・レジスタンス水平線
TPライン: 半透明ライン。TP1が最も薄く、TP3が最も濃い
BEストップライン: BE発動中にゴールドのラインで表示
上位足スイング: 4時間足のスイングレベルを参考表示(細い半透明ライン)
グレー背景: ADXがしきい値以下の横ばいゾーン(このゾーンではエントリーしません)
ステータステーブル: 全エントリー条件と現在の状態をリアルタイム表示
このストラテジーは主に1時間〜4時間足の暗号資産トレンドフォローを想定して設計されています。デフォルト設定はDOGEの2時間足で最適化されています。実運用の前に必ずご自身の対象銘柄・時間足でバックテストを行ってください。過去の結果は将来の利益を保証するものではありません。
Pine Script® strategy
Pine Script® strategy
Canuck Trading KAMA StrategyCanuck Trading KAMA Strategy
OVERVIEW
Canuck Trading KAMA is a strategy around one core idea: trade the color, manage the exit. Kaufman's Adaptive Moving Average (KAMA) determines trend direction. A dual health system handles all exit decisions.
Two user inputs control the strategy: Trade Direction and Max Entry Distance.
Everything else auto-calibrates from price action.
CORE CONCEPTS
KAMA (Kaufman Adaptive Moving Average)
KAMA adjusts its speed using the Efficiency Ratio (ER). ER measures how
much of the price path is directional versus noise. Trending markets
produce a fast KAMA that tracks price closely. Choppy markets produce a
slow KAMA that barely moves. This is the foundation of all signals.
Fair Value Band (FVB)
The colored line on the chart. Green means KAMA is rising (bullish),
red means KAMA is falling (bearish), gray means choppy (neutral).
Entries follow the color. Exits are managed by the health system.
Deviation Bands
Upper and lower bands are calculated from the standard deviation of
price around KAMA over 20 bars, scaled by 2.0 standard deviations.
Bands tighten in trends and widen in chop. This replaces the old
fixed ATR bands and adapts automatically to any instrument.
ENTRY SIGNALS
Color Trend Entry
When KAMA turns green, a long entry fires if price is within the max
entry distance from KAMA (the proximity gate). When KAMA turns red,
a short entry fires under the same proximity rule. A color settle gate
blocks entries on the first bar of a direct red-to-green or green-to-red
flip. Two consecutive bars of the new color are required to confirm the
trend is real and not a one-bar chop spike.
In squeeze conditions (bands tight relative to their own average),
the proximity gate is bypassed entirely since price is naturally close
to KAMA during squeezes.
Gray Zone Entry
When KAMA is gray (neutral), entries can still fire if structural
confirmation is present. Gray longs require 2 or more gray bars,
a higher low (buyers defending), and price above KAMA. Gray shorts
require 2 or more gray bars, a lower high (sellers capping), and
price below KAMA. No proximity gate is applied to gray entries.
The health system and follow-through exit manage risk.
EXIT CHAIN
Exits are evaluated every bar in priority order. The first matching
condition triggers the exit.
1. Follow-Through
On the bar after entry, if price closes below the entry close (for
longs) or above the entry close (for shorts), the position is closed
immediately. This catches entries that fail to confirm on the next bar.
2. Health Exit
The dual health system scores the position from 0 to 6. If either
sub-score drops to 0, or the combined score falls to 1 or below,
the position is closed. A minimum holding period of 2 bars (3 in
high volatility) prevents premature exits on entry noise.
3. Gray Fade
During gray periods, if 2 or more consecutive bars show structural
deterioration (lower highs while long, higher lows while short),
the position is closed. The pullback is deepening, not stabilizing.
4. Gray Timeout
If a position remains in gray for longer than twice the average
color run length (minimum 6 bars), the position is closed. The
trend that justified the entry is likely over.
5. Direction Exit
A full color reversal closes the position. Green to red exits longs.
Red to green exits shorts. Gray pauses do not trigger this exit.
DUAL HEALTH SYSTEM
Two independent scores evaluate position quality from different angles.
KAMA Health (0-3)
C - Color: bar color supports the position direction
K - Slope: KAMA is still moving in the position's favor
D - Duration: the color run has not exceeded the average run length
Price Health (0-3)
S - Structure: higher lows for longs, lower highs for shorts
M - Momentum: efficiency ratio is rising (directional energy building)
V - Value: price on the favorable side of KAMA
The dashboard shows both scores with their individual factors. For example,
K2 CK. P1 ..V means KAMA health is 2 (Color and Slope passing, Duration
failing) and Price health is 1 (only Value passing).
VOLATILITY ADAPTATION
The strategy adapts to volatility regimes automatically.
Squeeze Detection
When bands are tight relative to their 20-bar average (ratio below 0.7),
the dashboard shows SQUEEZE. The proximity gate is bypassed for color
entries since sigma-normalization inflates distances unreliably in
tight-band conditions.
High Volatility
When bands are wide relative to their average (ratio above 1.3), the
dashboard shows HIGH-VOL. The minimum holding period extends from 2 to
3 bars to give trades more room in volatile conditions.
Chop Detection
When the smoothing constant falls below the geometric mean of its range,
KAMA enters gray (choppy). A rolling chop ratio tracks how many of the
last 10 bars were gray. Above 50 percent triggers the CHOP indicator
on the dashboard.
USER INPUTS
Trade Direction
Long, Short, or Both. Default: Long.
Controls which side of the market the strategy trades.
Max Entry Distance (sigma)
Default: 1.0. Range: 0.1 and up, step 0.1.
Maximum sigma-distance from KAMA for color trend entries. Lower values
require price to be closer to KAMA before entering. Higher values allow
entries further from fair value. Gray entries bypass this setting.
The effective distance is scaled inversely by band width ratio, so it
automatically tightens in volatile conditions and loosens in squeezes.
DASHBOARD
The dashboard displays 10 rows of live information.
Row 0 Canuck Trading KAMA v5.0 header
Row 1 Price - current close
Row 2 KAMA - fair value level, colored by trend
Row 3 Trend - BULLISH, BEARISH, or NEUTRAL
Row 4 Signal - current entry or exit signal with health score
Row 5 Position - LONG, SHORT, or FLAT
Row 6 P&L - open profit/loss with percentage
Row 7 ER - efficiency ratio with trend strength label
Row 8 Band - position within bands and volatility regime
Row 9 Health - dual health scores with factor breakdown
STRATEGY SETTINGS
Initial Capital: 100,000
Position Size: 10 percent of equity
Pyramiding: disabled (one position at a time)
Commission: 0.1 percent per trade
Slippage: 1 tick
Order Execution: process orders on close
Calculation: on bar close only
INTERNAL PARAMETERS
These values are fixed and proven through extensive testing. They are not
exposed as inputs to prevent over-optimization.
ER Length: 10 (Kaufman standard)
Fast Period: 2 (fastest smoothing in strong trends)
Slow Period: 30 (slowest smoothing in pure chop)
Deviation Length: 20 (band width lookback)
Band Multiplier: 2.0 (standard deviations for band width)
CHANGES FROM v3.2
- ATR bands replaced with self-tuning KAMA deviation bands
- Quality scoring system removed entirely
- Candle pattern detection removed entirely
- Gray zone intelligence replaced with structural confirmation entries
- Smart hold/verdict system replaced with dual health scoring
- Band profit-taking removed
- KAMA smoothing option removed (raw Kaufman behavior only)
- Sharp flip protection retained and enhanced with color settle gate
- Follow-through exit added (entry close confirmation)
- Gray fade exit added (structural deterioration detection)
- Gray timeout exit added (adaptive based on average run length)
- Dashboard reduced from 13 rows to 10
- Max Entry Distance added as configurable input
- Codebase reduced from 900+ lines to approximately 540 lines
DISCLAIMER
This strategy is provided for educational and informational purposes only.
It is not financial advice, and it does not constitute a recommendation to
buy, sell, or hold any security or financial instrument.
Past performance in backtesting does not guarantee future results. All
trading involves risk, including the potential loss of principal. You are
solely responsible for your own trading decisions.
The author makes no warranties regarding the accuracy, completeness, or
reliability of this strategy. Use it at your own risk. Always do your own
research and consult a qualified financial advisor before making investment
decisions.
This strategy uses simulated order execution with process_orders_on_close
enabled, which means backtest results assume fills at the closing price of
the signal bar. Live trading conditions including slippage, liquidity, and
execution delays may produce different results.
Pine Script® strategy
Evasive SuperTrend Strategy [Source Select]🛡️ Evasive SuperTrend Strategy
The Evasive SuperTrend is a high-performance evolution of the classic SuperTrend indicator, engineered to solve the "choppiness" problem. While standard SuperTrends often fail in sideways markets by producing frequent false signals, the Evasive version utilizes dynamic expansion logic to "step back" from market noise.
🚀 The "Evasive" Edge
Typical trend trackers are rigid—they either stay flat or move closer to the price. This script introduces a Noise Avoidance Logic. When the price enters a pre-defined "Noise Zone," the indicator expands its buffer (Expansion Alpha) instead of tightening. This gives the asset room to breathe, preventing premature exits and keeping you in the trend during temporary volatility.
🛠️ Key Parameters
Source Select (Versatility): Unlike standard versions, you can choose any source (hl2, close, ohlc4, etc.). This is vital for volatile assets like XRP or ETH, where long wicks can trigger false trend reversals.
Noise Threshold (Sensitivity): Defines the distance (in ATR units) where the market is considered "noisy."
Expansion Alpha (The Buffer): The coefficient by which the trend line retreats when noise is detected. This effectively filters out market "hiccups."
📊 Visual Guide
Solid Band: The market is stable, and the trend is confirmed.
Dotted Band: The "Evasive" logic is active. The price is currently in the Noise Zone, and the script is actively filtering for false breakouts.
Color Coding: Teal represents a Bullish trend, while Maroon indicates a Bearish trend.
📈 Strategy & Backtesting
The script is fully optimized for Deep Backtesting on TradingView.
Default Setup: 10 ATR Length, 3.0 Multiplier.
Best Timeframes: 15m, 1h, and 4h.
Risk Management: Includes a built-in 0.05% commission model to reflect realistic trading conditions on exchanges like Binance.
⚠️ Disclaimer
Trading involves significant risk. This strategy is a technical analysis tool and does not guarantee profits. Always perform your own due diligence and test the settings on a demo account before live trading.
Suggested Tags:
SuperTrend Evasive Trend Following Algo Trading Noise Filter Backtest
Pine Script® strategy
Turtle Swing v2.0A faithful adaptation of Richard Dennis's legendary Turtle Trading System, retuned for the weekly timeframe on NSE/BSE equities. Where the original Turtles traded daily commodity futures, this version trades weekly breakouts on Indian stocks — filtering out the noise of intraday swings and focusing on high-conviction trend moves that last weeks to months.
Pine Script® strategy
APEX V2 [JOAT]APEX V2
Introduction
APEX V2 Enhanced is an advanced open-source algorithmic trading strategy that synthesizes 9 proprietary analytical concepts through a sophisticated confluence system to generate high-probability trade signals. This strategy integrates Flow Absorption Module (FAM), Directional Bias Engine (DBE), Structure Mapping System (SMS), Volatility Classification (VCL), Momentum Divergence Module (MDM), Statistical Reversion Zones (SRZ), Order Flow Analysis (OFA), Anchor Deviation Bands, and Trend Momentum Signals into a unified trading framework with comprehensive risk management.
Unlike single-indicator strategies that produce frequent false signals, APEX V2 requires multi-dimensional confluence before executing trades. This confluence-based approach dramatically reduces false positives while capturing high-conviction institutional moves. The strategy includes adaptive position sizing based on risk percentage, dynamic stop loss and take profit levels, trailing stops, and real-time performance tracking through a comprehensive dashboard.
Why This Strategy Exists
This strategy addresses the fundamental challenge of trading: distinguishing high-probability setups from market noise. Individual analytical methods often produce conflicting signals, leading to whipsaws and losses. APEX V2 solves this by requiring multiple independent confirmation signals before entering trades, ensuring that:
Institutional Activity is Confirmed: FAM and OFA detect when large players are positioning
Directional Bias is Established: DBE quantifies market sentiment through probabilistic analysis
Structural Context is Validated: SMS identifies key support/resistance levels
Volatility Regime is Appropriate: VCL ensures trades occur in favorable volatility conditions
Momentum Divergence is Present: MDM confirms smart money positioning through multi-oscillator divergence
Mean Reversion Opportunity Exists: SRZ identifies statistical extremes for reversal trades
Order Flow is Toxic: OFA detects aggressive institutional buying/selling
Anchor Deviation is Extreme: Multi-timeframe VWAP deviation signals absorption zones
Trend Momentum Confirmation: Trend-following signals with minimal lag
Each analytical module provides a unique perspective on market structure. By requiring confluence across multiple dimensions, APEX V2 captures only the highest-quality setups where institutional activity, technical structure, momentum, volatility, and order flow all align.
Strategy Components Explained
1. Flow Absorption Module (FAM)
FAM analyzes VWAP deviation across 2-minute, 5-minute, and 15-minute timeframes to identify institutional liquidity absorption zones. When price deviates significantly from VWAP (default: 8.0 sigma on 2m/5m, 4.0 sigma on 15m) combined with volume surges (2.25x average) and sufficient relative volume (0.6+), FAM signals institutional absorption.
The strategy requires 2+ timeframe confirmation for FAM signals. Buy signals occur when price is below VWAP with volume surge across multiple timeframes (institutions absorbing at lows). Sell signals occur when price is above VWAP with volume surge (institutions distributing at highs).
FAM contributes 1 point to the confluence score when absorption is detected, indicating institutional players are actively positioning at price extremes.
2. Directional Bias Engine (DBE)
DBE calculates directional bias by analyzing the ratio of bullish vs bearish bars over a lookback period (default: 100 bars) combined with momentum analysis. The engine weights directional bias (60%) and momentum bias (40%) to produce a combined bias score ranging from -1.0 (extreme bearish) to +1.0 (extreme bullish).
When combined bias exceeds the threshold (default: 0.65), DBE signals bullish bias. When below -0.65, it signals bearish bias. This probabilistic approach quantifies market sentiment and filters trades against the prevailing bias.
DBE contributes 1 point to confluence when bias aligns with trade direction, ensuring trades flow with statistical probability rather than against it.
3. Structure Mapping System (SMS)
SMS detects structural pivot highs and pivot lows using configurable left/right bar parameters (default: 10 bars each). The system maintains arrays of the 10 most recent resistance and support levels, then checks if current price is within 1% of any tracked level.
When price approaches support (within 1% of recent pivot lows), SMS signals potential bounce. When price approaches resistance (within 1% of recent pivot highs), SMS signals potential rejection. These structural levels represent areas where price previously reversed, making them high-probability zones for future reversals.
SMS contributes 1 point to confluence when price is near support (for longs) or resistance (for shorts), providing structural context for entries.
4. Volatility Classification (VCL)
VCL classifies current volatility regime using ATR percentile ranking over a lookback period (default: 100 bars). The system calculates normalized ATR (ATR / price * 100) and determines its percentile rank. High volatility is defined as 70th percentile or above, low volatility as 30th percentile or below.
While VCL doesn't directly contribute to confluence scoring, it provides critical context displayed in the dashboard. High volatility regimes may require wider stops, while low volatility regimes may produce more reliable mean reversion signals.
The strategy adapts to volatility by using ATR-based position sizing and stop loss placement, ensuring risk management scales with market conditions.
5. Momentum Divergence Module (MDM)
MDM detects multi-oscillator divergences by comparing price pivots with RSI pivots. Bullish divergence occurs when price makes lower lows but RSI makes higher lows (indicating weakening selling pressure). Bearish divergence occurs when price makes higher highs but RSI makes lower highs (indicating weakening buying pressure).
The system tracks divergence counts and requires a minimum number of divergences (default: 2) before signaling. This prevents single-divergence false signals and ensures sustained divergence patterns.
MDM contributes 1 point to confluence when divergence aligns with trade direction, confirming that smart money is positioning against the prevailing price trend.
6. Statistical Reversion Zones (SRZ)
SRZ combines Bollinger Bands with RSI to identify statistical extremes for mean reversion trades. The system calculates Bollinger Bands (default: 20-period, 2.0 standard deviations) and RSI (default: 14-period) to detect oversold and overbought conditions.
Oversold signals occur when price is below the lower Bollinger Band AND RSI is below 30. Overbought signals occur when price is above the upper Bollinger Band AND RSI is above 70. These dual conditions ensure both price and momentum are at extremes.
SRZ contributes 1 point to confluence when statistical extremes align with trade direction, identifying high-probability mean reversion opportunities.
7. Order Flow Analysis (OFA)
OFA detects institutional order flow through toxicity analysis and absorption coefficient calculation. The toxicity index measures aggressive vs passive order flow by analyzing candle position and volume. When toxicity exceeds threshold (default: 0.7), it indicates institutions are aggressively taking liquidity.
The absorption coefficient quantifies institutional absorption by measuring volume intensity relative to price movement. High absorption (default: 0.75+) with minimal price movement indicates institutions are positioning without moving price significantly.
OFA calculates a confidence score (0-100%) based on absorption strength and toxicity. When confidence exceeds minimum threshold (default: 75%), OFA signals high-probability institutional activity.
OFA contributes 1 point to confluence when institutional footprints are detected with high confidence, confirming large players are actively positioning.
8. Anchor Deviation Bands
Anchor Deviation analyzes multi-timeframe VWAP deviation (2m, 5m, 15m) combined with oscillator sigma gap confirmation. The system calculates VWAP deviation using configurable methods (Price Volatility, Z-Score, or Spread StDev) and measures the gap between VWAP deviation and oscillator z-scores.
Buy signals occur when 2+ timeframes show negative VWAP deviation (price below VWAP) with 2+ timeframes confirming oscillator gap. Sell signals occur when 2+ timeframes show positive VWAP deviation with gap confirmation.
Anchor Deviation contributes 1 point to confluence when multi-timeframe tension is detected, indicating price is at extreme deviation from institutional reference levels.
9. Trend Momentum Signals
Trend Momentum Signals use a zero-lag EMA combined with volatility bands and trend strength analysis. The system calculates a zero-lag EMA by compensating for lag (EMA of price + (price - price )), then applies volatility bands using ATR multiplier (default: 1.5x).
The trend strength score is calculated by comparing current zero-lag EMA with historical values over a loop range (default: 1-70 bars). Long signals occur when trend score exceeds uptrend threshold (default: 5) AND price is above the upper volatility band. Short signals occur when trend score is below downtrend threshold (default: -5) AND price is below the lower volatility band.
Trend Momentum contributes 1 point to confluence when trend signals align with trade direction, providing trend-following confirmation with minimal lag.
10. Deviation Reversion System Component
The Deviation Reversion System component calculates deviation levels from a moving average (configurable: WMA, SMA, RMA, EMA, HMA). Three deviation levels are defined (default: 1.3%, 7.5%, 13.3%) representing progressively extreme deviations from the mean.
Buy signals occur when price drops below the first deviation level (mean - 1.3%). Sell signals occur when price rises above the first deviation level (mean + 1.3%). This component identifies when price has deviated sufficiently from its mean to warrant mean reversion trades.
Deviation Reversion contributes 1 point to confluence when price is at deviation extremes, complementing the SRZ module with a simpler percentage-based approach.
Confluence System & Signal Aggregation
APEX V2's core innovation is its confluence system. The strategy counts bullish and bearish signals from all 9 analytical modules:
FAM: Absorption buy/sell (2+ timeframe confirmation)
DBE: Bullish/bearish bias (>0.65 or <-0.65)
SMS: Near support/resistance (within 1%)
MDM: Bullish/bearish divergence (2+ divergences)
SRZ: Oversold/overbought (BB + RSI extremes)
OFA: Institutional buy/sell (75%+ confidence)
Anchor Deviation: Tension buy/sell (2+ timeframe + gap confirmation)
Deviation Reversion: Buy/sell signal (price at deviation levels)
Trend Momentum: Long/short signal (trend score + volatility bands)
When confluence mode is enabled (default: ON), the strategy requires a minimum number of modules to agree (default: 3 out of 9) before executing trades. This dramatically reduces false signals by ensuring multiple independent perspectives confirm the setup.
If both long and short signals meet confluence requirements simultaneously, the strategy selects the direction with more confirming modules. If tied, no trade is executed to avoid ambiguous setups.
Risk Management System
APEX V2 includes comprehensive risk management:
Position Sizing: Calculated based on risk per trade percentage (default: 2% of equity). The system calculates stop distance using ATR and sizes positions so that if stopped out, the loss equals exactly 2% of account equity.
Stop Loss: Set at a percentage below entry (default: 2% for longs, 2% above for shorts). Stops are placed immediately upon entry to limit maximum loss per trade.
Take Profit: Set at a percentage above entry (default: 4% for longs, 4% below for shorts). This provides a 2:1 reward-to-risk ratio.
Trailing Stop: Activates when take profit level is reached, then trails price by a percentage (default: 1.5%). This locks in profits while allowing winners to run.
Reversal Exits: If an opposite signal meets confluence requirements while in a position, the strategy immediately closes the current position. This prevents holding losing positions when market structure shifts.
Strategy Properties & Backtesting Parameters
The strategy uses realistic backtesting parameters to avoid misleading results:
Initial Capital: $10,000 (realistic for average retail trader)
Position Size: 100% of equity (controlled by risk-based position sizing)
Pyramiding: 3 (allows up to 3 positions in same direction)
Commission: Should be set to realistic levels (0.1% for crypto, 0.05% for forex, $1-5 per trade for stocks)
Slippage: Should be set to realistic levels (5-10 ticks for liquid markets)
Risk Per Trade: 2% (sustainable risk level)
Stop Loss: 2% (prevents catastrophic losses)
Take Profit: 4% (2:1 reward-to-risk ratio)
These parameters ensure backtesting results reflect realistic trading conditions. The strategy is designed to generate 100+ trades over a sufficient dataset to produce statistically significant results.
Visual Elements
FAM Gradient Ribbon: 5-layer cyan/magenta ribbon showing liquidity absorption intensity around VWAP
OFA Gradient Ribbon: 5-layer gold/indigo ribbon showing institutional order flow intensity
Anchor Deviation Ribbon: 5-layer teal/purple ribbon showing multi-timeframe VWAP tension
Entry Signals: Green triangle up for LONG entries, red triangle down for SHORT entries
Position Markers: Small circles below/above bars indicating active positions
Stop Loss Lines: Red lines showing stop loss levels for active positions
Take Profit Lines: Green lines showing take profit targets for active positions
Average Entry Price: White line showing average entry price for active positions
Comprehensive Dashboard: Real-time metrics including position status, P&L, signal confluence, individual module status, and performance metrics
Dashboard Metrics
The dashboard displays 20+ real-time metrics:
Position Status:
Status: LONG, SHORT, or FLAT
Position Size: Current position quantity
P&L: Open profit/loss in currency and percentage
Signal Confluence:
Bull Signals: Count of bullish indicators (X/9) with checkmark if confluence met
Bear Signals: Count of bearish indicators (X/9) with checkmark if confluence met
Individual Indicator Status:
FAM: BUY/SELL with deviation value
DBE: BULL/BEAR with bias score
SMS: SUP/RES (support/resistance proximity)
VCL: HIGH/LOW/NORM with percentile
MDM: BULL/BEAR with RSI value
SRZ: OS/OB (oversold/overbought) with RSI value
OFA: INST+/INST-/TOX+/TOX- with confidence percentage
ADB: BUY/SELL with deviation value
TMS: LONG/SHORT with trend score
Performance Metrics:
Win Rate: Percentage and win/loss ratio
Net Profit: Currency and percentage return
Equity: Current equity and percentage change from initial capital
Input Parameters
Strategy Settings:
Enable LONG/SHORT Trades: Toggle trade directions
Require Multi-Module Confluence: Enable/disable confluence requirement
Minimum Confluence Count: Number of modules that must agree (1-7, default: 3)
FAM Settings:
Enable FAM, VWAP Mode, Deviation Method, Volume Lookback, Volume Surge Multiplier, RVOL Threshold, 2m/5m/15m Thresholds, Show Gradient Ribbon
DBE Settings:
Enable DBE, Bias Lookback, Bias Threshold, Momentum Weight
SMS Settings:
Enable SMS, Pivot Left/Right Bars, Structure Lookback
VCL Settings:
Enable VCL, ATR Length, Regime Lookback, High/Low Vol Thresholds
MDM Settings:
Enable MDM, RSI Length, Pivot Lookback, Min Divergences
SRZ Settings:
Enable SRZ, Bollinger Length/Multiplier, RSI Length, RSI Overbought/Oversold
OFA Settings:
Enable OFA, Toxicity Lookback/Threshold, Min Absorption Coefficient, Minimum Confidence %, Show Gradient Ribbon
Anchor Deviation Settings:
Enable Anchor Deviation, VWAP Dev Mode, 2m/5m/15m VWAP Thresholds, 2m/5m/15m Osc σ-Gap Thresholds, Show Gradient Ribbon
Deviation Reversion Settings:
Enable Deviation Reversion System, MA Type, MA Period, Deviation 1/2/3 percentages
Trend Momentum Settings:
Enable Trend Momentum Signals, Zero Lag Length, Volatility Multiplier, Loop Start/End, Threshold Uptrend/Downtrend
Risk Management Settings:
Enable Stop Loss, Stop Loss %, Enable Take Profit, Take Profit %, Enable Trailing Stop, Trailing Stop %, Risk Per Trade %
Visualization Settings:
Show Entry/Exit Signals, Show Dashboard, Show All Gradient Ribbons, Ribbon Brightness Adjust
How to Use This Strategy
Step 1: Configure Backtesting Parameters
Set realistic commission and slippage in Strategy Properties. For crypto: 0.1% commission, 10 ticks slippage. For forex: 0.05% commission, 5 ticks slippage. For stocks: $1-5 per trade commission, 5 ticks slippage.
Step 2: Set Risk Parameters
Configure Risk Per Trade (default: 2%), Stop Loss (default: 2%), and Take Profit (default: 4%). These provide sustainable risk management with 2:1 reward-to-risk ratio.
Step 3: Choose Confluence Level
Set Minimum Confluence Count based on your risk tolerance. Higher confluence (4-5 indicators) produces fewer but higher-quality signals. Lower confluence (2-3 indicators) produces more signals but with more false positives.
Step 4: Enable/Disable Indicators
Toggle individual modules based on market conditions and your trading style. For trending markets, emphasize DBE, Trend Momentum, and Anchor Deviation. For ranging markets, emphasize SRZ, MDM, and Deviation Reversion.
Step 5: Monitor Dashboard
Watch the dashboard for signal confluence. When Bull Signals shows 3+/9 with checkmark, the strategy is ready to enter long. When Bear Signals shows 3+/9 with checkmark, ready to enter short.
Step 6: Review Individual Indicators
Check which specific modules are signaling. High-quality setups show alignment across multiple module types (institutional + technical + momentum + volatility).
Step 7: Backtest on Sufficient Data
Run backtests on datasets that generate 100+ trades for statistical significance. Review win rate, net profit, maximum drawdown, and profit factor.
Step 8: Optimize Parameters
Adjust module parameters for your specific instrument and timeframe. Avoid over-optimization - parameters should work across multiple instruments and time periods.
Step 9: Forward Test
After backtesting, forward test on paper trading or small live positions to validate strategy performance in real market conditions.
Step 10: Monitor Performance
Track Win Rate, Net Profit, and Equity metrics in the dashboard. If performance degrades, re-evaluate parameters or market conditions.
Best Practices
Use on liquid instruments with sufficient volume for reliable signals
Higher confluence (4-5 modules) is recommended for beginners to reduce false signals
Lower confluence (2-3 modules) can be used by experienced traders who can filter signals manually
Backtest on multiple timeframes (5m, 15m, 1h, 4h) to find optimal timeframe for your instrument
Use realistic commission and slippage - overly optimistic parameters produce misleading results
Risk no more than 2% per trade to ensure account survival during drawdown periods
Monitor VCL (Volatility Classification) - high volatility may require wider stops or reduced position size
Combine with higher timeframe trend analysis - trading with the trend improves win rate
Review individual module signals to understand why confluence was met
Disable modules that consistently produce false signals for your specific instrument
Enable trailing stops to lock in profits on winning trades
Use pyramiding (default: 3) to add to winning positions when additional confluence signals appear
Avoid trading during major news events - volatility spikes can invalidate technical signals
Backtest over multiple market conditions (trending, ranging, high volatility, low volatility)
Forward test for at least 100 trades before committing significant capital
Strategy Limitations
Requires sufficient historical data for all modules - may not work well on newly listed instruments
Multi-timeframe analysis (FAM, Anchor Deviation) requires data availability on 2m, 5m, 15m timeframes
Confluence requirement reduces trade frequency - may produce few signals on some instruments/timeframes
Backtesting results are historical and do not guarantee future performance
Strategy performance degrades during extreme volatility events (flash crashes, circuit breakers)
Commission and slippage significantly impact profitability - must use realistic values
Pyramiding can amplify losses if market reverses after adding to position
Stop loss placement using fixed percentage may be suboptimal during volatility regime changes
Module parameters optimized for one instrument may not work on others
Requires regular monitoring and parameter adjustment as market conditions evolve
Dashboard metrics are real-time snapshots and can change rapidly during volatile periods
Strategy assumes sufficient liquidity to execute at desired prices - may not work on illiquid instruments
Trailing stops can be triggered by normal volatility, closing winning trades prematurely
Reversal exits may close positions too early if opposite signal is temporary
Technical Implementation
Built with Pine Script v6 using:
9 independent analytical modules with individual enable/disable controls
Multi-timeframe security requests for FAM and Anchor Deviation (2m, 5m, 15m)
Confluence-based signal aggregation with configurable minimum threshold
Risk-based position sizing using ATR and account equity
Dynamic stop loss, take profit, and trailing stop management
Strategy.entry and strategy.exit functions for automated trade execution
Reversal exit logic to close positions when opposite confluence is met
Three 5-layer gradient ribbons (FAM, OFA, Anchor Deviation) with progressive transparency
Comprehensive dashboard with 20+ real-time metrics using table visualization
5 alert conditions for trade signals and position changes
Performance tracking (win rate, net profit, equity) displayed in dashboard
Pyramiding support (up to 3 positions) for scaling into winning trades
The code is fully open-source and can be modified to suit individual trading styles and risk tolerances.
Originality Statement
This strategy is original in its multi-confluence approach to algorithmic trading. The strategy synthesizes multiple analytical concepts into a unified framework:
It synthesizes 9 proprietary analytical concepts into a unified confluence system
The confluence requirement dramatically reduces false signals compared to single-method strategies
Each concept provides a unique perspective: institutional activity (FAM, OFA), directional bias (DBE), structural context (SMS), volatility regime (VCL), momentum divergence (MDM), mean reversion (SRZ), anchor deviation (multi-timeframe), and trend following (Trend Momentum)
Risk management system uses ATR-based position sizing to risk exactly 2% per trade regardless of stop distance
Reversal exit logic closes positions when opposite confluence is met, preventing holding losing positions during structure shifts
Comprehensive dashboard synthesizes 20+ metrics into actionable intelligence
Three gradient ribbons (FAM, OFA, Anchor Deviation) provide visual confirmation of institutional activity and order flow
Strategy is designed with realistic backtesting parameters (commission, slippage, position sizing) to avoid misleading results
Pyramiding support allows scaling into winning positions when additional confluence appears
Individual module enable/disable controls allow customization for different market conditions and trading styles
The strategy's value lies in its systematic approach to trade selection through multi-dimensional confluence. By requiring agreement across institutional activity, technical structure, momentum, volatility, and order flow, APEX V2 captures only the highest-quality setups where all factors align. This reduces emotional decision-making and provides a repeatable, testable framework for algorithmic trading.
Disclaimer
This strategy is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Past performance does not guarantee future results. Backtesting results are hypothetical and may not reflect actual trading performance. Always use proper risk management, never risk more than you can afford to lose, and thoroughly test any strategy on paper before committing real capital. Commission, slippage, and market conditions significantly impact profitability. No strategy works in all market conditions. Regular monitoring and parameter adjustment are required.
-Made with passion by officialjackofalltrades
Pine Script® strategy
Anti-Equal PricesOverview
This strategy identifies Equal Highs and Equal Lows - key liquidity zones where stop losses cluster - and enters counter-trend trades when price taps these levels. Based on the smart money concept that institutions sweep liquidity at obvious levels before reversing.
How It Works
1.
Level Detection: Scans the last 30 bars to find the highest high and lowest low
2.
Equal Level Identification: Counts how many bars have touched within tolerance of these extremes. If 2+ bars touched the same level, it's considered an "Equal High" or "Equal Low"
3.
Entry Trigger: When price touches an established equal level, the strategy enters a counter-trade (short at equal highs, long at equal lows)
4.
Exit: Fixed stop loss and take profit in points
Why Equal Highs/Lows Matter
Equal highs form obvious resistance where retail traders place sell stops above
Equal lows form obvious support where retail traders place buy stops below
Smart money "sweeps" these levels to trigger stops before reversing
This strategy fades the breakout, anticipating the reversal
Pine Script® strategy
SPY VWAP + Squeeze BreakoutThis Pine Script® v6 strategy, titled SPY VWAP + Squeeze Breakout, is designed to capture momentum shifts in the SPY ETF by combining volatility filters with volume-weighted price action. The core logic utilizes Bollinger Bands and Keltner Channels to identify "squeeze" periods, which occur when volatility contracts and the Bollinger Bands move inside the Keltner Channels. A long entry is triggered when the squeeze "fires" while the price is trading above the VWAP and the current bar closes higher than its open. Conversely, a short position is initiated when the squeeze releases while the price is below the VWAP and the bar closes bearish. The strategy incorporates standard inputs for Bollinger Band length and standard deviation, as well as Keltner Channel length and multipliers for precise volatility tuning. Risk management is handled through dynamic exit logic that closes positions when the price crosses back over the VWAP line, signaling a potential trend reversal. By using ta.tr(true) for range calculations, the script ensures accurate volatility measurements even during sessions with significant price gaps. This trend-following approach aims to filter out market noise and focus on high-probability breakouts confirmed by both price location and momentum. Overall, the script provides a robust framework for backtesting SPY intraday volatility strategies directly on the TradingView platform.
Pine Script® strategy
Nifty Futures 45m | 200 EMA + RSI 50 Cross + Relative ATRwell driven and tested strategy with weklk defined entry and exit rule
Pine Script® strategy
REFLEX - QQQ NQ STRATREFLEX BUY SELL QQQ NQ STRAT
SMC Pro v3 Strategy - Liquidity Sweeps + FVG + BOS/CHoCH
Pine Script® strategy






















