OPEN-SOURCE SCRIPT
ที่อัปเดต: 8MA Compass — HTF map + GC/DC cues

8MA Compass provides a clean trend context by combining strict 4-of-4 confluence (Current TF vs Higher TF) with SMA200 repainting on Golden/Death Cross (GC/DC).
What it shows
SMA200 color on GC/DC (Current TF):
Why “8MA”? The 4-of-4 logic uses 8 moving averages in total: 4 on the Current TF and 4 on the HTF (EMA10/20 and SMA50/200 on both frames). HTF EMAs are used in calculations but are not plotted by default—hence the name 8MA Compass.
Auto HTF mapping
Settings
1. Display
2. Filter
3. Golden/Death
Alerts
Visual details
Usage
1. Use the 4-of-4 background as inter-timeframe momentum context.
2. Use SMA200 color to gauge long-term regime confirmation:
Disclaimer: For educational purposes only. Not financial advice. Trading involves risk.
What it shows
- 4-of-4 background (context): compares EMA10, EMA20, SMA50, SMA200 on the Current TF against the same four MAs on the Higher TF (HTF).
- All 4 above their HTF values → bullish background.
- All 4 below their HTF values → bearish background.
SMA200 color on GC/DC (Current TF):
- Last signal is DC and price below SMA200 → SMA200 turns red.
- Price above SMA200 but the last signal is DC (no GC afterward) → SMA200 stays base color.
- Last signal is GC and price above SMA200 → SMA200 turns green #089981.
Why “8MA”? The 4-of-4 logic uses 8 moving averages in total: 4 on the Current TF and 4 on the HTF (EMA10/20 and SMA50/200 on both frames). HTF EMAs are used in calculations but are not plotted by default—hence the name 8MA Compass.
Auto HTF mapping
- Current 1H → HTF 4H
- Current 4H → HTF 1D
- Current 1D → HTF 1W
- All other timeframes: HTF defaults to Current TF (4-of-4 will typically be neutral).
- Manual mode: choose any HTF. If Manual HTF equals Current TF, HTF SMAs are hidden to avoid overlap.
Settings
1. Display
- Show CURRENT TF — plot EMA10/20, SMA50/200 on Current TF.
- Show HARD TF — plot SMA50/200 on HTF (hidden if HTF == Current TF).
- HTF mode — Auto / Manual, with Hard TF (Manual) selector.
2. Filter
- Show base background (4-of-4) — enable/disable confluence shading.
- Epsilon (in ticks) — small tolerance in Cur vs HTF comparisons to reduce flicker.
3. Golden/Death
- Color SMA200 on GC/DC (Cur TF) — repaint SMA200 on GC/DC per rules above (enabled by default).
Alerts
- GC/DC (Current TF, SMA50/200): Golden Cross / Death Cross (on bar close).
- EMA10/20 (Current TF): “Bull regime ON” / “Bear regime ON” on crossovers.
- Optional HTF GC/DC alerts (SMA50/200 on chosen HTF).
Visual details
- HTF SMA50/200 are drawn first; Current TF lines are drawn on top for clarity.
- SMA200 (Current TF) is drawn last (and slightly thicker) to remain readable.
- HTF EMAs are used in 4-of-4 logic but not plotted by design.
Usage
1. Use the 4-of-4 background as inter-timeframe momentum context.
2. Use SMA200 color to gauge long-term regime confirmation:
- Prefer longs when last GC and price holds above SMA200 (#089981 line).
- Avoid longs when last DC and price is below SMA200 (red line).
Disclaimer: For educational purposes only. Not financial advice. Trading involves risk.
เอกสารเผยแพร่
Minor updateเอกสารเผยแพร่
MA Compass delivers a clean, actionable context by combining (1) regime-aware moving averages on the current timeframe, (2) a thin HTF SMA200 layer, and (3) Bill Williams Fractals with level lines for precise break/flip triggers.What changed vs the old “8MA Compass”
• Removed the “4-of-4” confluence logic and its background shading.
• Removed HTF EMA10/EMA20 and HTF SMA50 from logic and plots.
• Removed “Epsilon (ticks)” and all HTF-confluence inputs.
• Removed optional HTF GC/DC alerts.
• Kept Auto-HTF mapping; HTF layer is now SMA200 only (thin, 1 px).
• Added Bill Williams Fractals with mandatory Teeth filter (above/below).
• Added fractal level lines (Ray/Segment), max-lines cap, and auto-delete on break.
What it shows now
• Current TF: EMA21 (color = local trend), optional EMA10, SMA50, SMA200 (dynamic color).
• HTF: SMA200 (auto-mapped or manual).
• Fractals: BW triangles at pivot bars + horizontal fractal levels.
Color logic
• EMA21 color = local trend:
– Green → bullish bias.
– Red → bearish bias.
– Base line color → neutral/transition.
• SMA200 color (Current TF):
– Green (#089981): last signal is Golden Cross and price is above SMA200 → bullish regime.
– Red: last signal is Death Cross and price is below SMA200 → bearish regime.
– Blue (base): no strong regime → range or complex correction.
Simple trading workflow
1. Bias: Follow EMA21 color for the local trend. Best setups align with a green SMA200 for longs or a red SMA200 for shorts. If SMA200 is blue, expect chop/range; tighten risk.
2. Triggers (trade with the local trend):
– Bull case: break and close above the latest bearish-fractal level → optional retest (flip to support).
– Bear case: break and close below the latest bullish-fractal level → optional retest (flip to resistance).
3. Risk: Initial stop beyond the opposite fractal level (or k×ATR). Invalidate if EMA21 flips against you or SMA200 color degrades (e.g., green → blue/red for longs).
4. Management: Scale at prior swing levels; trail behind newly formed fractals. Avoid fresh entries when SMA200 is blue and EMA21 keeps flipping (choppy regime).
5. HTF context: Prefer trades that also look reasonable vs the HTF SMA200 slope (visually rising/falling), but do not override local invalidation rules.
เอกสารเผยแพร่
Minor updateเอกสารเผยแพร่
What this isA compact, execution-ready context tool: regime MAs on the current timeframe, an always-on anti-chop filter, Bill Williams fractals with actionable level lines, and AO/AC “add” signals with quotas. The goal is simple—separate real trend from noise and give precise, level-based triggers.
What changed vs previous builds
- Removed HTF SMA200 entirely (no calculations, no plots).
- Focus is now 100% on current timeframe signals and structure.
What it shows
- Current-TF MAs: EMA10 (optional), EMA21 (trend color), SMA50, SMA200 (dynamic color on GC/DC + price side).
- Fractals & levels: confirmed BW fractals with horizontal levels (Ray/Segment), auto-delete on break, max lines cap.
- AO/AC adds: AC 2/3, AO Saucer, AO Zero-line Cross—quota-limited per side to curb signal spam.
- Anti-chop (always on): trades/signals are considered only when the EMA21↔SMA50 separation is large relative to ATR.
Color logic
1. EMA21: green = bullish bias, red = bearish, base color = transition.
2. SMA200:
- green → last signal is GC and price is above SMA200 (bullish regime)
- red → last signal is DC and price is below SMA200 (bearish regime)
- blue (base) → no strong regime (range/transition)
Calculations & filters
- EMA10/21 regime: stable state from confirmed crossovers (1 / −1 / 0).
- GC/DC state: confirmed on bar close; held as persistent regime.
- Anti-chop: compute |EMA21 − SMA50| and normalize by ATR(14). “Trend OK” switches on above 0.50 and off below 0.35—this filters out flat conditions.
- Fractals: only confirmed pivots (right-side window complete) become levels; broken levels are removed.
- AO/AC adds: only when regime + anti-chop are active; unified quota limits how many adds per side you get.
How to read it
- EMA21 color = local trend.
- SMA200 color = regime. Green favors longs; red favors shorts; blue = caution.
- Fractal levels = triggers. A close through the most recent opposite fractal is your clean break/flip.
- AO/AC segments = adds. Useful for scaling with trend, not for fading it.
- No “Trend OK”? Expect chop. Patience typically outperforms activity here.
How I’d trade it (concise workflow)
- Context first: EMA21 must agree with your trade direction; SMA200 ideally supports it (green for longs, red for shorts).
- Trigger: wait for a close through the relevant fractal level; a quick retest/hold is a quality boost.
- Risk: stop beyond the opposite fractal or use k × ATR(14) (k ≈ 1.2–1.8). Fixed % risk per trade; no martingale.
- Management: partials at prior swings; trail behind newly formed fractals or EMA21.
- Adds: use AO/AC add signals selectively and within the quota. Not every add is genuine—learn to filter them with your process and supplement with other data/indicators (e.g., volume/OBV, session/market structure, volatility regime, your own HTF context).
- Important: we do not recommend blindly entering on every breakout. Require confirmation (close beyond level, context aligned, anti-chop on), then act.
Inputs (quick guide)
- Display: toggle EMA10/21/SMA50/SMA200; dynamic SMA200 coloring on GC/DC.
- Fractals: auto/ manual window, triangle markers ON/OFF.
- Fractal Lines: Ray/Segment, style/width/transparency, max lines, auto-delete broken.
- AO/AC: choose add types (AC 2/3, AO Saucer, AO Z-Cross), segment lengths, max adds per side (quota).
- Paint Bars: optional AO/AC zone coloring for quick visual scanning.
Notes & limitations
- No repainting: fractals only after right-window completion; GC/DC on bar close; alerts fire on confirmed events.
- Anti-chop reduces—but cannot eliminate—range noise. Blue SMA200 + frequent EMA flips = tighten risk or stand aside.
- Thin/illiquid symbols can generate many nearby fractals; widen the fractal window and/or lower the line cap.
Disclaimer: Educational use only. Not financial advice. Trading carries risk.
เอกสารเผยแพร่
What changed vs previous builds- Removed fractals and level lines entirely (no pivots, no auto-lines).
- Removed GC/DC coloring logic; SMA200 is now two-state: green if price is above, red if below.
- Still no HTF SMA200 (no hidden calc/plots) — the focus remains on current TF.
- Added a Dashboard (Daily AO/AC/PMO, SMA50D/200D, SMA50W, Daily PP SuperTrend, ATR(14) %/pts).
Color logic
- EMA21: green = local bullish bias (EMA10≥EMA21), red = local bearish.
- SMA200: green if price above, red if below.
Calculations & filters
- EMA10/21 regime: stable state from confirmed crossovers (1 / −1).
- Anti-chop: compute normGap = |EMA21−SMA50| / ATR(14).
- “Trend OK” on above 0.50, off below 0.35 (hysteresis to avoid flicker).
- AO/AC adds: fire only when regime + anti-chop are active; unified quota caps adds per side.
- Sub-4H adds: optional — controlled by a toggle; by default OFF (keeps LTF noise muted).
How to read it
- EMA21 color = your local trend on the active chart.
- SMA200 color = simple context line (above = green, below = red).
- AO/AC segments = adds with the trend, not mean-reversion entries.
- If Trend OK is off, expect chop; patience usually wins here.
Intra-day playbook, using the Dashboard
1) Pre-trade scan (Dashboard, Daily context):
- PP SuperTrend (D): prefer trading with its direction.
- SMA50D / SMA200D / SMA50W: price above these favors longs; below favors shorts.
- AO/AC (D): bright green/red hints momentum alignment; faded tones = fading momentum.
- ATR(14D): use % mode to judge relative volatility for sizing/targets.
2) Local setup:
- Require EMA21 color to agree with your direction; price relation to SMA200 should not contradict.
- Ensure Trend OK = on (anti-chop). If off — skip or tighten drastically.
- Trigger (since fractal lines are removed):
- Use a close beyond a recent swing (your own structure),
- or a clean break & hold above/below EMA21,
- or a retest of broken swing/EMA21 that holds.
- (Don’t treat adds as standalone entries; they are scale-ins with trend.)
3) Execution & management:
- Stop: beyond the opposite swing or k × ATR(14) of your chart TF (k ≈ 1.2–1.8).
- Targets: prior swings / measured move / volatility-based (ATR).
- Trail: behind EMA21 or the last confirmed local swing.
- Adds: take only when AO/AC add prints and Trend OK is on. Respect the quota.
- Not every add is genuine — filter using your process (volume/OBV, session structure, liquidity pools, HTF bias).
- Sub-4H users: turn “Enable adds below 4H” ON if you want adds on 1H; keep OFF if you only want adds on ≥4H.
4) Avoid / reduce risk when:
- Dashboard is mixed (PP SuperTrend (D) vs Daily MAs in conflict).
- ATR(14D) is unusually low or high relative to your plan (position sizing mismatch).
- Local EMA flips are frequent and Trend OK keeps toggling — that’s range behavior.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
✅My Telegram
t.me/trading_mura
t.me/trading_mura
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
✅My Telegram
t.me/trading_mura
t.me/trading_mura
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน