OPEN-SOURCE SCRIPT
APEX V2 [JOAT]

APEX V2 [JOAT]
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:
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[lag])), 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:
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:
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

Dashboard Metrics
The dashboard displays 20+ real-time metrics:
Position Status:
Signal Confluence:
Individual Indicator Status:
Performance Metrics:
Input Parameters
Strategy Settings:
FAM Settings:
DBE Settings:
SMS Settings:
VCL Settings:
MDM Settings:
SRZ Settings:
OFA Settings:
Anchor Deviation Settings:
Deviation Reversion Settings:
Trend Momentum Settings:
Risk Management Settings:
Visualization Settings:
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
Strategy Limitations
Technical Implementation
Built with Pine Script v6 using:
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:
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
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[lag])), 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
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
#1 Full Stack AI Trading Community
💎 Website: jackofalltrades.vip
💎 discord.com/invite/joat
💎 Telegram: t.me/jackofalltradesvip
💎 instagram.com/jackofalltrades.vip/
2026: The Era of AI Trading 📈
💎 Website: jackofalltrades.vip
💎 discord.com/invite/joat
💎 Telegram: t.me/jackofalltradesvip
💎 instagram.com/jackofalltrades.vip/
2026: The Era of AI Trading 📈
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
#1 Full Stack AI Trading Community
💎 Website: jackofalltrades.vip
💎 discord.com/invite/joat
💎 Telegram: t.me/jackofalltradesvip
💎 instagram.com/jackofalltrades.vip/
2026: The Era of AI Trading 📈
💎 Website: jackofalltrades.vip
💎 discord.com/invite/joat
💎 Telegram: t.me/jackofalltradesvip
💎 instagram.com/jackofalltrades.vip/
2026: The Era of AI Trading 📈
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.