[DAOL] Market Mode Signals

751
⏺️ What is it?

[DAOL] Market Mode Signals identifies uptrend, downtrend, range and transition conditions, then applies different signal rules to each environment.

It combines EMA alignment and slope, DMI/ADX, Kaufman’s Efficiency Ratio and a prior-bar price channel. ATR adjusts setup tolerances and stop buffers to recent volatility.

The indicator displays confirmed BUY/SELL signals and tracks one signal at a time using fixed reference, stop and target levels.

It is an indicator, not an order execution system or a Strategy Tester backtest.

⏺️ Indicator นี้คืออะไร?

[DAOL] Market Mode Signals เป็นอินดิเคเตอร์ที่แยกสภาวะตลาดเป็น ขาขึ้น ขาลง ไซด์เวย์ และช่วงเปลี่ยนผ่าน แล้วเลือกเงื่อนไขสัญญาณให้เหมาะกับแต่ละสภาวะ

ผสมหลักการ EMA, DMI/ADX, Efficiency Ratio และกรอบราคาจากแท่งก่อนหน้า พร้อมใช้ ATR ปรับระยะตามความผันผวน

แสดงสัญญาณ BUY/SELL เมื่อแท่งปิดยืนยัน และติดตามครั้งละหนึ่งรอบ พร้อมตรึงราคาอ้างอิง Stop และ Target

เป็นอินดิเคเตอร์สำหรับประกอบการวิเคราะห์ ไม่ได้ส่งคำสั่งซื้อขายหรือแสดงผล Backtest ใน Strategy Tester

⏺️ How are market conditions classified?

🔹 UPTREND: Fast EMA above slow EMA, rising slow EMA, +DI above −DI, and ADX/ER meeting the trend thresholds.
🔹 DOWNTREND: Fast EMA below slow EMA, falling slow EMA, −DI above +DI, and ADX/ER meeting the trend thresholds.
🔹 RANGE: Both ADX and ER at or below their range thresholds.
🔹 TRANSITION: None of the above conditions is satisfied.

By default, a condition must persist for two consecutive closed bars before becoming the confirmed market mode. New setups also require the current classification to agree with that confirmed mode.

ADX measures trend strength; the EMA and DI conditions determine direction.

⏺️ แยกสภาวะตลาดอย่างไร?

🔹 UPTREND: EMA สั้นอยู่เหนือ EMA ยาว เส้นยาวมีความชันขึ้น +DI มากกว่า −DI และ ADX/ER ผ่านเกณฑ์แนวโน้ม
🔹 DOWNTREND: EMA สั้นอยู่ใต้ EMA ยาว เส้นยาวมีความชันลง −DI มากกว่า +DI และ ADX/ER ผ่านเกณฑ์แนวโน้ม
🔹 RANGE: ADX และ ER ต่ำกว่าหรือเท่ากับเกณฑ์ไซด์เวย์ทั้งคู่
🔹 TRANSITION: เงื่อนไขไม่เข้ากลุ่มข้างต้น ระบบงดสร้างจังหวะใหม่

ค่าเริ่มต้นรอสภาวะเดียวกัน สองแท่งปิดต่อเนื่อง ก่อนยืนยันโหมด และเงื่อนไขปัจจุบันต้องตรงกับโหมดยืนยันจึงจะเริ่มสร้างจังหวะได้

ADX ใช้อ่านความแข็งแรงของแนวโน้ม ส่วน EMA และ DI ใช้อ่านทิศทาง

⏺️ How are signals generated?

Trend signals

In an uptrend, price must test the fast EMA area and close back above it with a bullish body, while respecting the slow EMA conditions. A subsequent bar must close above the setup close with a bullish body.

The downtrend signal uses the opposite conditions.

Range signals

In a range, price must test the lower or upper channel area and close inside the channel with a directional body:

🔹 Lower-area rejection → potential BUY setup
🔹 Upper-area rejection → potential SELL setup

A subsequent bar must close further in the proposed direction with a matching candle body. The target is the frozen channel midpoint, and the signal must satisfy the minimum reward-to-risk requirement.

Both signal types require confirmation within the setup expiry window and within one frozen ATR of the setup close. A setup is cancelled if its stop boundary is touched, the market classification changes, or the setup expires. Range setups are also cancelled if price closes at or beyond either frozen channel boundary.

⏺️ สัญญาณเกิดขึ้นอย่างไร?

สัญญาณตามแนวโน้ม

ตลาดขาขึ้น: ราคาทดสอบบริเวณ EMA สั้น แล้วปิดกลับเหนือเส้นด้วยแท่งขึ้น โดยยังผ่านเงื่อนไข EMA ยาว จากนั้นรอแท่งถัดไปปิดสูงกว่าราคาปิดของแท่งตั้งต้น พร้อมเป็นแท่งขึ้น

ตลาดขาลง: ใช้เงื่อนไขตรงข้าม เพื่อรอราคาเด้งแล้วอ่อนตัวต่อ

สัญญาณไซด์เวย์

ราคาทดสอบบริเวณขอบกรอบ แล้วปิดกลับอยู่ภายในกรอบด้วยแท่งที่สนับสนุนทิศทาง:

🔹 ทดสอบขอบล่างแล้วฟื้น → รอ BUY
🔹 ทดสอบขอบบนแล้วอ่อนตัว → รอ SELL

จากนั้นรอแท่งยืนยันปิดเดินหน้าต่อในทิศทางนั้น โดย เป้าหมายอยู่ที่กึ่งกลางกรอบที่ตรึงไว้ และต้องมี Reward/Risk ผ่านเกณฑ์ขั้นต่ำ

ทั้งสองรูปแบบต้องยืนยันภายในเวลาที่กำหนด และราคายืนยันต้องห่างจากราคาปิดแท่งตั้งต้นไม่เกินหนึ่ง ATR ที่ตรึงไว้

ระบบยกเลิกจังหวะเมื่อแตะขอบเขต Stop สภาวะตลาดเปลี่ยน หรือหมดเวลารอยืนยัน สำหรับจังหวะไซด์เวย์จะยกเลิกเพิ่มเติมเมื่อราคาปิดถึงหรือออกนอกขอบกรอบที่ตรึงไว้

⏺️ Reading the chart

🔹 BUY Trend / SELL Trend: Confirmed trend-pullback signal
🔹 BUY Range / SELL Range: Confirmed range-rebound signal
🔹 White line: Signal closing-price reference
🔹 Red line: Fixed stop reference
🔹 Green line: Fixed target reference

Background colors show the confirmed market mode:

🔹 Green — uptrend
🔹 Red — downtrend
🔹 Aqua — range
🔹 Gray — transition

BUY indicates a long-direction setup. SELL indicates a short-direction setup, not an instruction to close an existing long position.

⏺️ วิธีอ่านกราฟ

🔹 BUY Trend / SELL Trend: สัญญาณย่อหรือเด้งตามแนวโน้มที่ยืนยันแล้ว
🔹 BUY Range / SELL Range: สัญญาณฟื้นหรืออ่อนตัวจากขอบกรอบไซด์เวย์ที่ยืนยันแล้ว
🔹 เส้นขาว: ราคาปิดของแท่งสัญญาณ ใช้เป็นราคาอ้างอิง
🔹 เส้นแดง: ระดับ Stop ที่ตรึงไว้
🔹 เส้นเขียว: ระดับ Target ที่ตรึงไว้

สีพื้นหลังแสดงโหมดตลาดที่ยืนยัน:

🔹 เขียว — ขาขึ้น
🔹 แดง — ขาลง
🔹 ฟ้า — ไซด์เวย์
🔹 เทา — ช่วงเปลี่ยนผ่าน

BUY หมายถึงจังหวะฝั่ง Long ส่วน SELL หมายถึงจังหวะฝั่ง Short ไม่ใช่คำสั่งปิด Long ที่ถืออยู่

⏺️ Signal tracking and reference levels

The entry reference is the signal bar’s close. It is not a guaranteed execution price.

The stop is placed beyond the setup bar’s low or high, with a frozen ATR buffer and tick-size rounding.

🔹 Trend target — two times the reference risk by default
🔹 Range target — the frozen channel midpoint
🔹 Range minimum reward/risk — 1.2 by default

Tracking begins on the bar after the signal. Levels remain fixed, and a change in market mode alone does not end an active signal.

Tracking ends when:

🔹 STOP: Only the stop level is touched
🔹 TARGET: Only the target level is touched
🔹 BOTH: Both levels are touched within one bar; their order is unknown
🔹 EXPIRE: Neither level has been touched within the maximum tracking period

These markers describe price-level touches. They do not calculate realized returns or order fills.

⏺️ การติดตามสัญญาณและระดับอ้างอิง

ราคาอ้างอิงเข้าคือ ราคาปิดแท่งสัญญาณ ไม่ใช่ราคาที่รับประกันว่าจะซื้อขายได้จริง

Stop อยู่เลยจุดต่ำหรือสูงของแท่งตั้งต้น โดยเพิ่มระยะ ATR ที่ตรึงไว้ และปรับตามขนาด Tick

🔹 เป้าหมาย Trend — ค่าเริ่มต้นสองเท่าของระยะเสี่ยงอ้างอิง
🔹 เป้าหมาย Range — กึ่งกลางกรอบที่ตรึงไว้
🔹 Reward/Risk ขั้นต่ำของ Range — ค่าเริ่มต้น 1.2

เริ่มตรวจระดับตั้งแต่ แท่งถัดจากแท่งสัญญาณ ระดับจะคงที่ และการเปลี่ยนโหมดตลาดเพียงอย่างเดียวไม่ทำให้รอบที่ติดตามอยู่สิ้นสุด

เครื่องหมายสิ้นสุดรอบ:

🔹 STOP: แตะเฉพาะระดับ Stop
🔹 TARGET: แตะเฉพาะระดับ Target
🔹 BOTH: แตะทั้งสองระดับในแท่งเดียว ไม่ทราบว่าแตะระดับใดก่อน
🔹 EXPIRE: ยังไม่แตะระดับใดเมื่อครบระยะติดตาม

เครื่องหมายเหล่านี้แสดงการแตะระดับราคา ไม่ใช่ผลกำไรขาดทุนหรือการจับคู่คำสั่งซื้อขายจริง

⏺️ Settings and alerts

Signal modes:

🔹 Auto: Allow trend and range signals according to market conditions
🔹 Trend Only: Allow trend signals only
🔹 Range Only: Allow range signals only

Key defaults:

🔹 EMA — 20 / 50
🔹 DMI/ADX — 14
🔹 Efficiency Ratio — 20
🔹 Trend thresholds — ADX ≥ 22 and ER ≥ 0.30
🔹 Range thresholds — ADX ≤ 18 and ER ≤ 0.20
🔹 Prior-bar channel — 40 bars
🔹 ATR — 14, using the preceding bar’s value
🔹 Market confirmation — 2 closed bars
🔹 Setup confirmation window — up to 3 subsequent bars
🔹 Tracking expiry — 80 subsequent bars
🔹 Cooldown — 5 complete bars after tracking ends

Alerts are available for each signal type, any BUY, any SELL and tracking completion. Set alerts to “Once Per Bar Close” and recreate them after changing inputs or code.

⏺️ การตั้งค่าและ Alert

เลือกโหมดได้:

🔹 Auto: ใช้ทั้งสัญญาณ Trend และ Range ตามสภาวะตลาด
🔹 Trend Only: ใช้เฉพาะสัญญาณตามแนวโน้ม
🔹 Range Only: ใช้เฉพาะสัญญาณไซด์เวย์

ค่าเริ่มต้นสำคัญ:

🔹 EMA — 20 / 50
🔹 DMI/ADX — 14
🔹 Efficiency Ratio — 20
🔹 เกณฑ์ Trend — ADX ≥ 22 และ ER ≥ 0.30
🔹 เกณฑ์ Range — ADX ≤ 18 และ ER ≤ 0.20
🔹 กรอบราคาจากแท่งก่อนหน้า — 40 แท่ง
🔹 ATR — 14 ใช้ค่าจากแท่งก่อนหน้า
🔹 ยืนยันโหมด — 2 แท่งปิด
🔹 รอยืนยันจังหวะ — ไม่เกิน 3 แท่งถัดไป
🔹 หมดระยะติดตาม — 80 แท่งถัดไป
🔹 เว้นระยะหลังจบรอบ — 5 แท่งเต็ม

มี Alert แยกตามประเภทสัญญาณ รวม BUY รวม SELL และเมื่อสิ้นสุดการติดตาม ตั้งเป็น Once Per Bar Close และสร้าง Alert ใหม่หลังเปลี่ยน Input หรือโค้ด

⏺️ Development and references

This Pine Script v6 implementation was written for this indicator without copying Community script code.

The extension combines market-mode confirmation, mode-specific setups, frozen setup references, cancellation rules and single-signal tracking.

The underlying EMA, DMI/ADX, ATR, Efficiency Ratio and price-channel concepts are established methods. No claim is made that the combination is globally unique or that it guarantees profitable signals.

References:

🔹 J. Welles Wilder Jr. — New Concepts in Technical Trading Systems (1978): Directional Movement, ADX and ATR
🔹 Perry J. Kaufman — Trading Systems and Methods: Efficiency Ratio
🔹 Donchian-style channels: historical highest-high and lowest-low references

Supporting documentation:

TradingView — Directional Movement

TradingView — Average True Range

TradingView — Kaufman’s Adaptive Moving Average

⏺️ การพัฒนาและอ้างอิง

เขียนด้วย Pine Script v6 สำหรับอินดิเคเตอร์นี้ โดยไม่คัดลอกโค้ดจากสคริปต์ Community

ส่วนที่พัฒนาต่อยอดคือการยืนยันโหมดตลาด การเลือกเงื่อนไขตามโหมด การตรึงระดับตั้งต้น การยกเลิกจังหวะที่ผิดเงื่อนไข และการติดตามครั้งละหนึ่งรอบ

EMA, DMI/ADX, ATR, Efficiency Ratio และกรอบราคาย้อนหลังเป็นหลักการที่มีอยู่แล้ว ไม่อ้างว่าแนวคิดผสมนี้ไม่เคยมีผู้ทำมาก่อน หรือรับประกันว่าสัญญาณจะทำกำไร

⏺️ Limitations and disclaimer

🔹 Use standard price charts. Synthetic chart types are rejected.
🔹 Settings are measured in bars; changing timeframe changes the elapsed time represented by each window.
🔹 The indicator has no TFEX-specific session filter, contract-roll handling or optimized S50/GO presets.
🔹 Market classification can lag or misclassify changing conditions.
🔹 Fixed stop and target references do not account for slippage, fees, gaps, liquidity or actual execution.
🔹 No win rate, profit factor or expected return has been established.
🔹 Static checks and basic level arithmetic were completed. TradingView compilation and market-data validation remain pending.
🔹 For educational and informational purposes only. Signals are analytical conditions, not personalized investment advice or guaranteed outcomes.

⏺️ ข้อจำกัดและคำชี้แจง

🔹 ใช้กับกราฟราคามาตรฐาน ระบบไม่รองรับกราฟราคาสังเคราะห์
🔹 การตั้งค่านับเป็นแท่ง เมื่อเปลี่ยน Timeframe ระยะเวลาจริงของแต่ละช่วงจะเปลี่ยนตาม
🔹 เวอร์ชันนี้ยังไม่มีตัวกรอง Session ของ TFEX การจัดการเปลี่ยนสัญญา หรือค่าที่ผ่านการปรับทดสอบเฉพาะ S50/GO
🔹 การจำแนกตลาดอาจล่าช้าหรือคลาดเคลื่อนเมื่อสภาวะเปลี่ยน
🔹 Stop/Target อ้างอิงไม่ได้รวม Slippage ค่าธรรมเนียม Gap สภาพคล่อง หรือการส่งคำสั่งจริง
🔹 ยังไม่มีผลยืนยัน Win Rate, Profit Factor หรือผลตอบแทนคาดหวัง
🔹 ตรวจโครงสร้างเบื้องต้นและสูตรระดับราคาแล้ว แต่ยังไม่ได้ compile ใน TradingView หรือทดสอบข้อมูลตลาดจริง
🔹 ใช้เพื่อการศึกษาและประกอบการวิเคราะห์ สัญญาณเป็นเงื่อนไขทางเทคนิค ไม่ใช่คำแนะนำลงทุนเฉพาะบุคคลหรือการรับประกันผลลัพธ์

Thông báo miễn trừ trách nhiệm

Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.