OPEN-SOURCE SCRIPT

Elliott Wave Full Fractal System v2.0

104
Elliott Wave Full Fractal System v2.0 – Q.C. FINAL (Guaranteed R/R)

Elliott Wave Full Fractal System is a multi-timeframe wave engine that automatically labels Elliott impulses and ABC corrections, then builds a rule-based, ATR-driven risk/reward framework around the “W3–W4–W5” leg.
“Guaranteed R/R” here means every order is placed with a predefined stop-loss and take-profit that respect a minimum Reward:Risk ratio – it does not mean guaranteed profits.

Core Idea
This strategy turns a full fractal Elliott Wave labelling engine into a systematic trading model.
It scans fractal pivots on three wave degrees (Primary, Intermediate, Minor) to detect 5-wave impulses and ABC corrections.
A separate “Trading Degree” pivot stream, filtered by a 200-EMA trend filter and ATR-based dynamic pivots, is then used to find W4 pullback entries with a minimum, user-defined Reward:Risk ratio.

Default Properties & Risk Assumptions
The backtest uses realistic but conservative defaults:

Pine Script®
// Default properties used for backtesting strategy( "Elliott Wave Full Fractal System - Q.C. FINAL (Guaranteed R/R)", overlay = true, initial_capital = 10000, // realistic account size default_qty_type = strategy.percent_of_equity, default_qty_value = 1, // 1% risk per trade commission_type = strategy.commission.cash_per_contract, commission_value = 0.005, // example stock commission slippage = 0 // see notes below )

  • Account size: 10,000 (can be changed to match your own account).
  • Position sizing: 1% of equity per trade to keep risk per idea sustainable and aligned with TradingView’s recommendations.
  • Commission: 0.005 cash per contract/share as a realistic example for stock trading.
  • Slippage: set to 0 in code for clarity of “pure logic” backtesting. Real-life trading will experience slippage, so users should adjust this according to their market and broker.

Always re-run the backtest after changing any of these values, and avoid using high risk fractions (5–10%+) as that is rarely sustainable.

1. Full Fractal Wave Engine
The script builds and maintains four pivot streams using ATR-adaptive fractals:
  1. Primary Degree (Macro Trend):
    Captures the large swings that define the major trend. Labels ①–⑤ and ⒶⒷⒸ using blue “Circle” labels and thicker lines.
  2. Intermediate Degree (Trading Degree):
    Captures the medium swings (swing-trading horizon). Uses teal labels ( (1)…(5), (A)(B)(C) ).
  3. Minor Degree (Micro Structure):
    Tracks short-term swings inside the larger waves. Uses red roman numerals (i…v, a b c).
  4. ABC Corrections (Optional):
    When enabled, the engine tries to detect standard A–B–C corrective structures that follow a completed 5-wave impulse and plots them with dashed lines.

Each degree uses a dynamic pivot lookback that expands when ATR is above its EMA, so the system naturally requires “stronger” pivots in volatile environments and reacts faster in quiet conditions.

2. Theory Rules & Strict Mode
  • Normal Mode: More permissive detection. Designed to show more wave structures for educational / exploratory use.
  • Strict Mode: Enforces key Elliott constraints:
    Wave 3 not shorter than waves 1 and 5.
    No invalid W4 overlap with W1 (for standard impulses).
  • ABC Logic: After a confirmed bullish impulse, the script expects a down-up-down corrective pattern (A,B,C). After a bearish impulse, it looks for up-down-up.

3. Trend Filter & Pivots
  • EMA Trend Filter: A configurable EMA (default 200) is used as a non-wave trend filter.
    Price above EMA → Only long setups are considered.
    Price below EMA → Only short setups are considered.
  • ATR-Adaptive Pivots: The pivot engine scales its left/right bars based on current ATR vs ATR EMA, making waves and trading pivots more robust in volatile regimes.

4. Dynamic Risk Management (Guaranteed R/R Engine)

The trading engine is designed around risk, not just pattern recognition:
  1. ATR-Based Stop:
    Stop-loss is placed at:
    Entry ± ATR × Multiplier (user-configurable, default 2.0).
    This anchors risk to current volatility.
  2. Minimum Reward:Risk Ratio:
    For each setup, the script:
    Computes the distance from entry to stop (risk).
    Projects a take-profit target at risk × min_rr_ratio away from entry.
    Only accepts the setup if risk is positive and the required R:R ratio is achievable.
  3. Result: Every order is created with both TP and SL at a predefined distance, so each trade starts with a known, minimum Reward:Risk profile by design.

“Guaranteed R/R” refers exclusively to this order placement logic (TP/SL geometry), not to win-rate or profitability.

5. Trading Logic – W3–W4–W5 Pattern

The Trading pivot stream (separate from visual wave degrees) looks for a simple but powerful pattern:
  1. Bullish structure:Sequence of pivots forms a higher-high / higher-low pattern.
    Price is above the EMA trend filter.
    A strong “W3” leg is confirmed with structure rules (optionally stricter in Strict mode).
  2. Entry (Long – W4 Pullback):The “height” of W3 is measured.
    Entry is placed at a configurable Fibonacci pullback (default 50%) inside that leg.
    ATR-based stop is placed below entry.
    Take-profit is projected to satisfy min Reward:Risk.
  3. Bearish structure:
    Mirrored logic (lower highs/lows, price below EMA, W3 down, W4 retrace up, W5 continuation down).

Once a valid setup is found, the script draws a colored box around the entry zone and a label describing the type of signal (“LONG SETUP” or “SHORT SETUP”) with the suggested limit price.

6. Orders & Execution
  • Entry Orders: The strategy uses limit orders at the computed W4 level (“Sniper Long” or “Sniper Short”).
  • Exits: A single strategy.exit() is attached to each entry with:
    Take-profit at the projected minimum R:R target.
    Stop-loss at ATR-based level.
  • One Trade at a Time: New setups are only used when there is no open position (strategy.opentrades == 0) to keep the logic clear and risk contained.

7. Visual Guide on the Chart
  • Wave Labels:Primary: ①,②,③,④,⑤, ⒶⒷⒸ
    Intermediate: (1)…(5), (A)(B)(C)
    Minor: i…v, a b c
  • Trend EMA: Single blue EMA showing the dominant trend.
  • Setup Boxes:Green transparent box → long entry zone.
    Red transparent box → short entry zone.
  • Labels: “LONG SETUP / SHORT SETUP” labels mark the proposed limit entry with price.

8. How to Use This Strategy
  1. Attach the strategy to your chart
    Choose your market (stocks, indices, FX, crypto, futures, etc.) and timeframe (for example 1h, 4h, or Daily). Then add the strategy to the chart from your Scripts list.

  2. Start with the default settings
    Leave all inputs on their defaults first. This lets you see the “intended” behaviour and the exact properties used for the published backtest (account size, 1% risk, commission, etc.).

  3. Study the wave map
    Zoom in and out and look at the three wave degrees:
    Blue circles → Primary degree (big picture trend).
    Teal (1)…(5) → Intermediate degree (swing structure).
    Red i…v → Minor degree (micro waves).

    Use this to understand how the engine is interpreting the Elliott structure on your symbol.

  4. Watch for valid setups
    Look for the coloured boxes and labels:
    Green box + “LONG SETUP” label → potential W4 pullback long in an uptrend.
    Red box + “SHORT SETUP” label → potential W4 pullback short in a downtrend.

    Only trades in the direction of the EMA trend filter are allowed by the strategy.

  5. Check the Reward:Risk of each idea
    For each setup, inspect:
    Limit entry price.
    ATR-based stop level.
    Projected take-profit level.

    Make sure the minimum Reward:Risk ratio matches your own rules before you consider trading it.

  6. Backtest and evaluate
    Open the Strategy Tester:
    Verify you have a decent sample size (ideally 100+ trades).
    Check drawdowns, average trade, win-rate and R:R distribution.
    Change markets and timeframes to see where the logic behaves best.
  7. Adapt to your own risk profile
    If you plan to use it live:
    Set Initial Capital to your real account size.
    Adjust default_qty_value to a risk level you are comfortable with (often 0.5–2% per trade).
    Set commission and slippage to realistic broker values.
    Re-run the backtest after every major change.
  8. Use as a framework, not a signal machine
    Treat this as a structured Elliott/R:R framework:
    • Filter signals by higher-timeframe trend, major S/R, volume, or fundamentals.
    • Optionally hide some wave degrees or ABC labels if you want a cleaner chart.
    • Combine the system’s structure with your own trade management and discretion.

Best Practices & Limitations
  • This is an approximate Elliott Wave engine based on fractal pivots. It does not replace a full discretionary Elliott analysis.
  • All wave counts are algorithmic and can differ from a manual analyst’s interpretation.
  • Like any backtest, results depend heavily on:
    Symbol and timeframe.
    Sample size (more trades are better).
    Realistic commission/slippage settings.
  • The 0-slippage default is chosen only to show the “raw logic”. In real markets, slippage can significantly impact performance.
  • No strategy wins all the time. Losing streaks and drawdowns will still occur even with a strict R:R framework.

Disclaimer

This script is for educational and research purposes only and does not constitute financial advice or a recommendation to buy or sell any security. Past performance, whether real or simulated, is not indicative of future results. Always test on multiple symbols/timeframes, use conservative risk, and consult your financial advisor before trading live capital.

면책사항

해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.