OPEN-SOURCE SCRIPT
Cập nhật TFEX_INDICATOR_SET13

This Indicator use the calculated RSI of the top 13 stocks that have the highest market capitalization in
SET50 where suitable for TFEX trading(
S501!).
Conducted with 2 RSI period as follow:
How to use:
1) Use this Indicator by Crossover
2) Use this Indicator by Divergence of RSI Main
3) The combination of Divergence and Crossover
Preferred Timeframe
Conducted with 2 RSI period as follow:
- RSI Main (14)
- RSI Average (100)
How to use:
1) Use this Indicator by Crossover
- If the RSI Main Cross UP the RSI Average can assume as BUY SIGNAL
- If the RSI Main Cross DOWN the RSI Average can assume as SELL SIGNAL
2) Use this Indicator by Divergence of RSI Main
- If the RSI Main got any Regular Bullish or Hidden Bullish can assume as BUY SIGNAL
- If the RSI Main got any Regular Bearish or Hidden Bearish can assume as SELL SIGNAL
3) The combination of Divergence and Crossover
- If the RSI Main got any Regular Bullish or Hidden Bullish then pending for the RSI Main Cross UP the RSI Average which can assume as BUY SIGNAL
- If the RSI Main got any Regular Bearish or Hidden Bearish then pending for the RSI Main Cross DOWN the RSI Average which can assume as SELL SIGNAL
Preferred Timeframe
- 4H
- 2H
- 1H
Phát hành các Ghi chú
Update name of the RSI appearance settingPhát hành các Ghi chú
Add Alert ConditionsPhát hành các Ghi chú
Change Calculation from SCB to EA as SCB delisted in SETPhát hành các Ghi chú
Update Alert condition to have Overbought and OversoldEdit last description: Change Calculation from SCB to CPN as SCB delisted in SET
Phát hành các Ghi chú
Update ChartPhát hành các Ghi chú
Update NEW SET13 List- AOT
- PTT
- DELTA
- PTTEP
- BCP
- CPALL
- KBANK
- DTAC
- BBL
- BDMS
- ESSO
- KTB
- GULF
Phát hành các Ghi chú
Update new stock listPhát hành các Ghi chú
═══════════════════════════════════════════ENGLISH
═══════════════════════════════════════════
Major update — signals, multi-timeframe confirmation, live edge tracking, per-stock heatmap.
NEW
• BUY/SELL signals with 3 modes: Crossover, Divergence, Combined (default). Labels on the candle pane. New alerts: "BUY", "SELL".
• Combined mode: divergence arms the direction; matching RSI cross fires the signal. Faint green/red background shows when armed.
• HTF Confirmation: see higher-timeframe composite RSI + regime at a glance (default 4H, configurable).
• Basket heatmap: per-stock RSI sorted descending, color-coded by zone — see which heavyweights drive the composite.
• Stats table on the candle pane: composite, slow, regime, HTF, breadth counts, last BUY/SELL price & time, rolling win-rate.
• Regime-aware background: 30–70 band tints green when fast > slow, red when fast < slow.
• Zone-colored fast line (lime >70, red <30, yellow middle). Cross triangles on every cross.
• Divergence strength: "BULL"/"BEAR" uppercase when pivot delta exceeds Strong Price Move % and Strong RSI Move thresholds; lowercase otherwise.
BASKET
• 13 basket tickers now editable in Settings — no code change needed. Defaults = SET50 top-13 by market cap (reviewed 2026-04-18): ADVANC, KTB, KBANK, SCB, PTTEP, GULF, DELTA, SCC, TRUE, PTT, AOT, TTB, PTTGC.
• SET50 rebalances ~every 6 months — review your basket regularly.
CHANGES
• Settings organized into groups: RSI, Divergence, Display, Signals, Basket.
• Slow RSI line red → orange (avoids clashing with bearish signaling).
• Hidden divergence opacity 80% → 50%.
USAGE
• Preferred timeframes: 1H, 2H, 4H. Apply to TFEX:S50!.
• All existing alerts preserved. Uses 39 request.security calls — under the 40-call limit.
═══════════════════════════════════════════
ภาษาไทย
═══════════════════════════════════════════
อัปเดตใหญ่ — เพิ่มสัญญาณซื้อ/ขาย, ยืนยันจาก Timeframe ใหญ่, ติดตาม Win Rate แบบสด, และ Heatmap รายหุ้น
ฟีเจอร์ใหม่
• สัญญาณ BUY/SELL พร้อม 3 โหมดให้เลือก: Crossover, Divergence, Combined (ค่าเริ่มต้น) แสดงบน pane แท่งเทียน แจ้งเตือนใหม่: "BUY", "SELL"
• Combined mode: Divergence จะ arm ทิศทางไว้ก่อน แล้วรอ RSI cross ในทิศเดียวกันจึงจะส่งสัญญาณ มีพื้นหลังสีเขียว/แดงจางๆ เมื่ออยู่ในสถานะรอ
• HTF Confirmation: ดูค่า RSI รวมและ Regime ของ Timeframe ใหญ่ได้ทันที (ค่าเริ่มต้น 4H ปรับได้)
• Basket heatmap: RSI รายหุ้น เรียงจากมากไปน้อย สีตาม zone สามารถเห็นได้ทันทีว่าหุ้นตัวไหนขับเคลื่อน RSI รวม
• ตารางสถิติบน pane แท่งเทียน: RSI รวม, RSI ช้า, Regime, HTF, จำนวนหุ้นเหนือ 50/70 และใต้ 30, ราคา+เวลาของ BUY/SELL ล่าสุด, Win Rate
• พื้นหลังตาม Regime: แถบ 30–70 เปลี่ยนเป็นเขียวเมื่อ RSI เร็ว > ช้า, เป็นแดงเมื่อกลับกัน
• เส้น RSI เร็วเปลี่ยนสีตาม zone (เขียวมะนาว >70, แดง <30, เหลืองตรงกลาง) + สามเหลี่ยมแสดงจุด Cross
• จำแนก Divergence แรง/อ่อน: "BULL"/"BEAR" ตัวใหญ่เมื่อ pivot มีระยะห่างเกินเกณฑ์ Strong Price Move % และ Strong RSI Move; ตัวเล็กเมื่อไม่เกิน
ตะกร้าหุ้น (Basket)
• แก้ไข 13 หุ้นในตะกร้าได้จาก Settings โดยไม่ต้องแก้โค้ด ค่าเริ่มต้น = SET50 Top 13 ตาม Market Cap (ทบทวนเมื่อ 2026-04-18): ADVANC, KTB, KBANK, SCB, PTTEP, GULF, DELTA, SCC, TRUE, PTT, AOT, TTB, PTTGC
• SET50 มีการปรับทุก ~6 เดือน ควรตรวจตะกร้าเป็นระยะ
สิ่งที่เปลี่ยน
• จัดกลุ่ม Settings: RSI, Divergence, Display, Signals, Basket
• เปลี่ยนสีเส้น RSI ช้าจากแดง → ส้ม (ป้องกันสับสนกับสัญญาณขาลง)
• ความทึบของ Hidden Divergence 80% → 50% (เห็นชัดขึ้น)
การใช้งาน
• Timeframe ที่แนะนำ: 1H, 2H, 4H ใช้กับ TFEX:S50!
• Alert เดิมทั้งหมดยังใช้ได้ ใช้ request.security 39 ครั้ง (ไม่เกินลิมิต 40)
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
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.