OPEN-SOURCE SCRIPT
ที่อัปเดต: HTF EMA Step Lines (21/50/200)

HTF EMA Step Lines (21/50/200)
Clean higher-timeframe MA levels on any chart. Flat, repaint-safe step lines for D/W/M — with optional labels, table, background cues, and alerts.
What it does
How it works
Inputs
Tips
Alerts
Notes
Clean higher-timeframe MA levels on any chart. Flat, repaint-safe step lines for D/W/M — with optional labels, table, background cues, and alerts.
What it does
- HTF Overlay: Shows 21 / 50 / 200 MAs from a higher timeframe (default Daily) on any chart.
- Step Line Style: Lines are flat within the HTF bar and only update when a new HTF bar begins.
- Repaint Control:
• Prior (default): previous confirmed HTF bar → no intraday repaint.
• Live: current HTF bar → updates intraday. - Extras: optional value labels, compact live values table, background cues, and %-distance label.
- Alerts: Cross-up/down events for each selected HTF line.
How it works
- Pulls HTF series with request.security.
- Prior mode: shifts values by [1] for stability.
- Detects new HTF bars using time.
- Plots with plot.style_stepline so levels remain flat until the next HTF open.
Inputs
- Higher Timeframe: D / W / M (or any valid TF).
- MA Type: EMA, SMA, or WMA.
- Show 21 / 50 / 200: toggle each line.
- Live vs Prior: choose Live (updates) or Prior (no repaint).
- Labels: show value label at each new HTF bar.
- Live Values Table: compact 2-column panel in top-right.
- BG Alignment: optional background tint when price > 21 > 50 > 200 (bull) or price < 200 (bear).
- % Distance: live label showing distance from HTF-21 in %.
- Styling: color & width per line.
Tips
- For intraday execution (e.g. 65-min), use Prior mode to avoid drift.
- Set HTF = W or M to get weekly/monthly lines without leaving your chart.
- A soft warning appears if chart TF ≥ HTF (lines still valid but less contextual).
Alerts
- Cross up/down alerts for 21/50/200 (compatible with Any alert() function call).
- Add alerts from the chart: Add Alert → Condition → This script.
Notes
- Built in Pine v5 — minimal, readable, fast.
- Levels are context tools, not signals.
- Colours are tuned for dark charts; adjust for WCAG contrast.
เอกสารเผยแพร่
HTF EMA Step Lines (21/50/200)Clean higher-timeframe MA levels on any chart. Flat, repaint-safe step lines for D/W/M — with optional labels, table, background cues, and alerts.
What it does
- HTF Overlay: Shows 21 / 50 / 200 MAs from a higher timeframe (default Daily) on any chart.
- Step Line Style: Lines are flat within the HTF bar and only update when a new HTF bar begins.
- Repaint Control:
• Prior (default): previous confirmed HTF bar → no intraday repaint.
• Live: current HTF bar → updates intraday. - Extras: optional value labels, compact live values table, background cues, and %-distance label.
- Alerts: Cross-up/down events for each selected HTF line.
How it works
- Pulls HTF series with request.security.
- Prior mode: shifts values by [1] for stability.
- Detects new HTF bars using time.
- Plots with plot.style_stepline so levels remain flat until the next HTF open.
Inputs
- Higher Timeframe: D / W / M (or any valid TF).
- MA Type: EMA, SMA, or WMA.
- Show 21 / 50 / 200: toggle each line.
- Live vs Prior: choose Live (updates) or Prior (no repaint).
- Labels: show value label at each new HTF bar.
- Live Values Table: compact 2-column panel in top-right.
- BG Alignment: optional background tint when price > 21 > 50 > 200 (bull) or price < 200 (bear).
- % Distance: live label showing distance from HTF-21 in %.
- Styling: color & width per line.
Tips
- For intraday execution (e.g. 65-min), use Prior mode to avoid drift.
- Set HTF = W or M to get weekly/monthly lines without leaving your chart.
- A soft warning appears if chart TF ≥ HTF (lines still valid but less contextual).
Alerts
- Cross up/down alerts for 21/50/200 (compatible with Any alert() function call).
- Add alerts from the chart: Add Alert → Condition → This script.
Notes
- Built in Pine v5 — minimal, readable, fast.
- Levels are context tools, not signals.
- Colours are tuned for dark charts; adjust for WCAG contrast.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้มันเป็นโอเพ่นซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันการทำงานของสคริปต์ได้ ขอแสดงความชื่นชมผู้เขียน! แม้ว่าคุณจะสามารถใช้งานได้ฟรี แต่อย่าลืมว่าการเผยแพร่โค้ดซ้ำนั้นจะต้องเป็นไปตามกฎระเบียบการใช้งานของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ ข้อกำหนดการใช้งาน