OPEN-SOURCE SCRIPT

Precision Edge System [JOAT]

6 037
Precision Edge System [JOAT]

Introduction

The Precision Edge System is an advanced open-source multi-timeframe trading strategy that combines Opening Range Breakout, Fair Value Gap detection, Break of Structure analysis, Order Block identification, Fibonacci confluence, volatility regime classification, multi-oscillator divergence, RSI-2 mean reversion, and adaptive risk management into a unified institutional-grade trading system. This strategy helps traders capture high-probability setups by requiring multiple independent confirmation signals before entering trades, significantly reducing false signals and improving win rates.

Unlike basic strategies that rely on single indicators, this system uses a confluence scoring approach where each component contributes points toward entry decisions. Opening Range provides context, Fair Value Gaps provide entry zones, Market Structure confirms direction, Order Blocks show institutional positioning, Fibonacci shows harmonic levels, Regime Detection filters conditions, Divergence warns of reversals, and RSI-2 catches pullbacks. The strategy is designed for traders who understand that the best setups occur when multiple institutional concepts align simultaneously.

Why This Strategy Exists

This strategy addresses the fundamental challenge of trading: most single-indicator strategies produce too many false signals or miss too many opportunities. By combining multiple institutional concepts with flexible confluence requirements, this strategy reveals:

  • Opening Range Breakout: First 30 minutes establish institutional positioning - breakouts signal directional commitment
  • Fair Value Gap Retests: Price imbalances that get filled - optimal entry zones with defined risk
  • Break of Structure: Swing high/low breaks confirm trend direction and momentum
  • Order Blocks: Last opposing candle before strong moves - institutional accumulation/distribution zones
  • Premium/Discount Arrays: Value context showing whether price is expensive or cheap
  • Fibonacci Confluence: Golden Pocket and multi-wave alignment for reversal zones
  • Volatility Regime Detection: Trending/Ranging/Choppy classification to avoid bad conditions
  • Multi-Oscillator Divergence: RSI/MACD/Stochastic divergence for reversal signals
  • RSI-2 Mean Reversion: Extreme oversold/overbought in trends for pullback entries
  • Session-Based Timing: London/New York kill zones for highest liquidity
  • Adaptive Risk Management: Dynamic stop loss, take profit, and trailing stops based on volatility


Each component provides independent confirmation. The strategy's power comes from requiring multiple components to align before entering trades, creating high-probability setups with favorable risk-reward ratios.



Core Strategy Components

1. Opening Range Breakout (ORB) System

The Opening Range is established during the first 30 minutes of the trading session (9:30-10:00 AM by default):

Pine Script®


Opening Range logic:
  • First 30 minutes = institutions establish positions
  • OR High/Low define the day's initial range
  • Breakouts above OR High = bullish bias
  • Breakouts below OR Low = bearish bias
  • OR levels used as stop loss reference points


The strategy can operate in two modes:
  • Breakout Required: Only trades after OR breakout (more selective)
  • Flexible: Trades inside OR if other confluence is strong (more frequent)


ORB contributes 2 points to confluence score when breakout occurs.

2. Fair Value Gap (FVG) Entry System

Fair Value Gaps are three-candle price imbalances that often get filled:

Pine Script®


FVG entry logic:
  • Identifies imbalance zones where price moved too fast
  • Waits for price to return to the gap (retest)
  • Enters at gap high (bullish) or gap low (bearish)
  • Provides precise entry with tight stop below/above gap


FVG retest contributes 2 points to confluence score. The strategy tracks active FVGs and removes them when filled.

3. Market Structure (BOS/CHoCH) Confirmation

Break of Structure confirms trend direction:

Pine Script®


Structure logic:
  • Tracks swing highs and lows using pivot detection
  • BOS = break in trend direction (continuation)
  • CHoCH = break against trend (potential reversal)
  • Internal structure shows nested patterns for timing


The strategy can operate in two modes:
  • BOS Required: Only trades after structure break (more selective)
  • Flexible: Trades without BOS if other confluence is strong (more frequent)


BOS contributes 2 points to confluence score when it occurs.

4. Order Block Detection and Mitigation

Order Blocks mark institutional positioning zones:

Pine Script®


Order Block logic:
  • Identifies last opposing candle before momentum shift
  • Requires volume and ATR confirmation
  • Strength classification (Strong = 4+ points, Normal = 2-3 points)
  • Tracks active blocks until mitigated (price closes through)


Active Order Blocks contribute 1 point to confluence score. Strong Order Blocks (high volume + high ATR) contribute an additional 1 point.

5. Premium/Discount Array Context

Premium/Discount Arrays show value context:

Pine Script®


Value Array logic:
  • Calculates 50-period range high/low
  • Equilibrium = 50% level (fair value)
  • Premium = upper 50% of range (expensive)
  • Discount = lower 50% of range (cheap)
  • Institutional bias: Buy discount, sell premium


Being in discount zone contributes 1 point to long confluence. Being in premium zone contributes 1 point to short confluence.

6. Fibonacci Confluence and Golden Pocket

Fibonacci analysis identifies harmonic reversal zones:

Pine Script®


Fibonacci logic:
  • Calculates Fibonacci retracements from multiple swing lengths
  • Golden Pocket (0.618-0.65) = highest probability reversal zone
  • Extensions (1.272, 1.414, 1.618) used for profit targets
  • Confluence zones where multiple Fib levels align


Being in Golden Pocket contributes 1 point to both long and short confluence (reversal zone).

7. Volatility Regime Filter

Regime detection classifies market conditions:

Pine Script®


Regime logic:
  • Trending (2): Directional market, use breakout strategies
  • Ranging (1): Oscillating market, use mean reversion
  • Choppy (0): Erratic market, avoid trading


The strategy can operate in two modes:
  • Avoid Choppy: No trades in choppy regime (more selective)
  • Trade All: Trades in all regimes if confluence is strong (more frequent)


Regime filter prevents trading in unfavorable conditions.

8. Multi-Oscillator Divergence Detection

Divergence analysis identifies momentum exhaustion:

Pine Script®


Divergence logic:
  • Regular divergence = potential reversal signal
  • Hidden divergence = trend continuation signal
  • Requires extreme zones (RSI >70 or <30) for best setups
  • Multi-oscillator confluence increases reliability


Bullish divergence contributes 2 points to long confluence. Bearish divergence contributes 2 points to short confluence.

9. RSI-2 Mean Reversion System

RSI-2 catches extreme pullbacks in trends:

Pine Script®


RSI-2 logic:
  • 2-period RSI is extremely sensitive to pullbacks
  • Oversold (<10) in uptrend = buy the dip
  • Overbought (>90) in downtrend = sell the rally
  • Requires 200 EMA trend filter for context


RSI-2 signals contribute 2 points to confluence score.

10. Candlestick Pattern Recognition

The strategy detects reversal patterns:

  • Hammer: Long lower wick, small body, bullish reversal
  • Shooting Star: Long upper wick, small body, bearish reversal
  • Bullish Engulfing: Bullish candle engulfs previous bearish candle
  • Bearish Engulfing: Bearish candle engulfs previous bullish candle
  • Morning Star: Three-candle bullish reversal pattern
  • Evening Star: Three-candle bearish reversal pattern


Strong patterns (with volume confirmation) contribute 2 points to confluence score.

11. Session-Based Timing (Kill Zones)

The strategy focuses on high-liquidity sessions:

  • London Session: 2:00-5:00 AM EST (default)
  • New York Session: 8:30-11:00 AM EST (default)
  • Silver Bullet: 9:00-10:00 AM EST (default)


Session logic:
  • Highest volume and volatility during these periods
  • Institutional participation is strongest
  • Better follow-through on breakouts
  • Can be disabled for 24-hour trading




Confluence Scoring System

The strategy uses a point-based confluence system where each component contributes points:

Long Confluence Points:
  • OR Breakout Up: +2 points
  • BOS Bullish: +2 points
  • FVG Bull Retest: +2 points
  • Active Bullish OB: +1 point
  • Strong Bullish OB: +1 point (bonus)
  • In Discount Zone: +1 point
  • In Golden Pocket: +1 point
  • RSI-2 Oversold: +2 points
  • Bullish Divergence: +2 points
  • Liquidity Below: +1 point
  • Volume Spike: +1 point
  • Bullish Momentum: +1 point
  • Bullish Pattern: +2 points


Entry Modes (Configurable):
  • Strict Mode: Requires 8+ points (very selective, highest quality)
  • Moderate Mode: Requires 6+ points (balanced approach)
  • Flexible Mode: Requires 4+ points (more frequent trades)
  • Aggressive Mode: Requires 3+ points (highest frequency)


This flexible system allows traders to adjust trade frequency based on their preference and market conditions.

Risk Management System

1. Stop Loss Placement:

The strategy uses intelligent stop loss placement:

  • OR-Based Stops: If OR is active, stop = OR Low (long) or OR High (short)
  • ATR-Based Stops: If no OR, stop = Entry ± (2 × ATR)
  • Structure-Based Stops: Can use swing lows/highs for stops


2. Position Sizing:

Risk-based position sizing:

Pine Script®


This ensures consistent risk per trade regardless of stop distance.

3. Take Profit Targets:

Adaptive take profit based on volatility:

Pine Script®


Default 2R target (2x risk) provides favorable risk-reward. High volatility increases target to 3R.

4. Trailing Stop System:

Adaptive trailing stop activates after profit threshold:

  • Activates after 1R profit (default)
  • Trails at breakeven + 0.5R
  • Locks in profits while allowing trend to run
  • Adjusts trail distance based on ATR


5. Time-Based Exits:

End-of-day exit prevents overnight risk:

  • Closes all positions at 3:55 PM EST (default)
  • Prevents gap risk and overnight exposure
  • Can be disabled for swing trading


6. Daily Trade Limit:

Maximum trades per day prevents overtrading:

  • Default: 10 trades per day maximum
  • Resets at start of each trading day
  • Prevents revenge trading and overexposure


Strategy Performance Metrics

The strategy displays real-time performance in the dashboard:

  • Confluence Scores: Current long/short confluence (0-20 scale)
  • OR Status: Active/Forming
  • Structure: Bullish/Bearish
  • BOS Signal: Confirmed/Pending
  • Regime: Trending/Ranging/Choppy
  • Value Zone: Premium/Discount/Equilibrium
  • RSI State: Overbought/Oversold/Neutral
  • Volatility: High/Normal/Low
  • Volume: Spike/High/Dry/Normal
  • Position: Long/Short/Flat
  • Net P/L: Current profit/loss
  • Win Rate: Percentage of winning trades
  • Total Trades: Number of closed trades
  • Profit Factor: Gross profit / Gross loss


Input Parameters

Trade Frequency:
  • Entry Mode: Strict/Moderate/Flexible/Aggressive
  • Min Confluence Score: 1-10 (lower = more trades)
  • Allow Partial Setups: Trade with 2/3 conditions met


Opening Range:
  • OR Session: Time range for OR (default 9:30-10:00)
  • ORB Filter: Enable/disable OR requirement
  • Fibonacci Extensions: Show extension levels
  • Breakout Required: Must break OR to trade


Market Structure:
  • Fractal Period: Swing detection length (default 5)
  • Require BOS/CHoCH: Must have structure break
  • Multi-TF Confluence: Check higher timeframe
  • Internal Structure: Show nested patterns


Order Blocks:
  • OB Filter: Enable/disable OB requirement
  • Volatility Threshold: ATR multiplier (default 1.2)
  • Volume Threshold: Volume multiplier (default 1.1)
  • Block Quality: All/Strong/Extreme


Fair Value Gaps:
  • FVG Entry: Enable/disable FVG entries
  • Min Imbalance: Percentage threshold (default 0.2%)
  • Zone Quality: All/Strong/Extreme
  • Auto-Fill Detection: Remove filled gaps


Risk Management:
  • Risk Per Trade: Percentage of equity (default 1%)
  • Reward Multiple: R multiple for TP (default 2.0)
  • Adaptive Take Profit: Adjust TP for volatility
  • EOD Exit: Close positions at end of day
  • Adaptive Trailing Stop: Enable trailing stops
  • Trail Activation: R multiple to activate (default 1.0)
  • Max Daily Trades: Limit trades per day (default 10)


How to Use This Strategy

Step 1: Configure Entry Mode
Choose entry mode based on desired trade frequency. Strict = fewer high-quality trades. Flexible = more frequent trades. Start with Moderate.

Step 2: Set Risk Parameters
Configure risk per trade (1% recommended), reward multiple (2R recommended), and position sizing. Never risk more than you can afford to lose.

Step 3: Enable Desired Components
Turn on/off components based on your trading style. All components enabled = most selective. Fewer components = more frequent trades.

Step 4: Monitor Dashboard
Watch confluence scores in real-time. Long score >6 = potential long setup. Short score >6 = potential short setup. Higher scores = better setups.

Step 5: Review Entry Labels
When strategy enters, it displays label with entry price, stop loss, take profit, and confluence score. Review to understand why trade was taken.

Step 6: Let Strategy Manage Exits
Strategy handles stop loss, take profit, trailing stops, and EOD exits automatically. Don't interfere with exits unless necessary.

Step 7: Analyze Performance
Review dashboard metrics regularly. Win rate >50%, profit factor >1.5, and positive net P/L indicate good performance.

Best Practices

  • Start with Moderate mode and adjust based on results
  • Higher confluence scores = higher win rates but fewer trades
  • Backtest thoroughly before live trading
  • Use realistic commission (0.075%) and slippage
  • Respect regime filter - avoid choppy markets
  • Session filter improves quality - trade kill zones
  • EOD exit prevents overnight risk for day traders
  • Daily trade limit prevents overtrading
  • Monitor dashboard for real-time confluence
  • Adjust parameters for different instruments and timeframes


Strategy Limitations

  • Confluence system can miss trades when components don't align
  • Multiple filters reduce trade frequency significantly
  • Backtesting results may not reflect live performance
  • Slippage and commission impact profitability
  • News events can invalidate technical setups
  • Regime detection may lag at transitions
  • Opening Range less reliable on low-volume days
  • Fair Value Gaps may not fill immediately
  • Order Blocks can fail in strong trends
  • Divergences can persist before reversing
  • The strategy shows high-probability setups, not guaranteed winners


Technical Implementation

Built with Pine Script v6 using:
  • Opening Range tracking with session detection
  • Fair Value Gap detection and retest monitoring
  • Market structure analysis with BOS/CHoCH detection
  • Order Block identification with strength classification
  • Premium/Discount Array calculations
  • Fibonacci confluence and Golden Pocket detection
  • Volatility regime classification system
  • Multi-oscillator divergence detection
  • RSI-2 mean reversion signals
  • Candlestick pattern recognition
  • Session-based timing filters
  • Confluence scoring algorithm
  • Adaptive risk management system
  • Real-time performance dashboard


The code is fully open-source and can be modified to suit individual trading styles and preferences.

Originality Statement

This strategy is original in its comprehensive institutional integration approach. While individual components (ORB, FVG, BOS, OB, Fibonacci, RSI, MACD) are established concepts, this strategy is justified because:

  • It synthesizes 11 distinct institutional concepts into unified confluence scoring system
  • The flexible entry mode system allows traders to adjust selectivity vs frequency
  • Adaptive risk management adjusts stops and targets based on volatility
  • Multi-component confluence significantly reduces false signals vs single-indicator strategies
  • Session-based timing focuses on high-liquidity periods for better execution
  • Regime filter prevents trading in unfavorable market conditions
  • Candlestick pattern integration adds reversal confirmation layer
  • Real-time dashboard presents 15 metrics simultaneously for complete strategy visibility
  • The strategy combines trend-following (BOS, ORB) with mean-reversion (RSI-2, Divergence) for versatility


Each component contributes independent confirmation: ORB shows context, FVG shows entry, BOS shows direction, OB shows positioning, Arrays show value, Fibonacci shows harmonics, Regime shows conditions, Divergence shows exhaustion, RSI-2 shows pullbacks, Patterns show reversals, and Sessions show timing. The strategy's value lies in requiring multiple components to align before entering trades, creating high-probability setups with favorable risk-reward ratios.

Disclaimer

This strategy is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss and is not suitable for all investors.

Past performance does not guarantee future results. Backtesting results are hypothetical and may not reflect actual trading performance. Actual results will vary due to slippage, commission, market conditions, and execution differences. The strategy may experience periods of drawdown and losing trades.

High confluence scores do not guarantee profitable trades. Market conditions change, and strategies that worked historically may not work in the future. News events, market shocks, and fundamental factors can override technical setups.

Always use proper risk management, including stop losses and position sizing appropriate for your account size and risk tolerance. Never risk more than you can afford to lose. Consider consulting with a qualified financial advisor before making investment decisions.

The author is not responsible for any losses incurred from using this strategy. Users assume full responsibility for all trading decisions made using this tool.

Recommended Settings for Backtesting

  • Initial Capital: $10,000 (realistic for average trader)
  • Commission: 0.075% per trade (realistic for most brokers)
  • Slippage: 1-2 ticks (depends on instrument liquidity)
  • Risk Per Trade: 1% of equity
  • Reward Multiple: 2R (2:1 risk-reward)
  • Entry Mode: Moderate (6+ confluence)
  • Timeframe: 5-minute or 15-minute chart
  • Instruments: Liquid stocks, forex majors, or major crypto
  • Sample Size: Minimum 100 trades for statistical significance


-Made with passion by officialjackofalltrades

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。