OPEN-SOURCE SCRIPT
Обновлено

Jan Buy, Hold, Add c TP/baghold-doi warning

1 044
This indicator is built on a trend-following framework combined with pullback entry and momentum confirmation. Its purpose is to help traders enter early in a developing uptrend and add to positions systematically when price pulls back within the main trend.

The strategy is structured around two buying phases.

Buy1 is the initial entry signal at the early stage of a trend. It is designed to capture the beginning of a bullish move when price structure starts turning positive and momentum confirms the setup. The goal of Buy1 is to establish a position early, before the trend fully expands.

Buy2 is the add-on entry during a pullback. It looks for a new swing low that remains higher than the previous swing low, while MACD also shows improving momentum. This signal is intended for adding to an existing position during a healthy retracement, with the Stop Loss anchored to the EMA100 in order to keep risk aligned with the primary trend.

Another key component is the “doi” warning signal. “Doi” is Thai stock-trader slang referring to buying near the top and getting stuck at the peak. In this indicator, the doi signal acts as a warning not to add more or open new positions at that stage, because the probability of ending up trapped near the high is increasing. In English, the closest concept would be baghold or bagholding risk.

For profit management, the script is not designed around exiting the full position at a single target. Instead, it follows a scale-out approach, allowing profits to be taken gradually as price extends and momentum evolves. This is intended to help traders stay with strong trends longer while reducing the risk of exiting too early.

This indicator works best on stocks or other assets that tend to move in sustained, directional trends. It is especially suitable for instruments that can trend for extended periods, because the logic is based on entering early in a trend and adding on constructive pullbacks, rather than trading short-term reversals in sideways conditions.

อินดิเคเตอร์นี้ถูกออกแบบบนแนวคิดของ trend following ร่วมกับ pullback entry และ momentum confirmation โดยมีเป้าหมายเพื่อช่วยให้นักลงทุนเริ่มเข้าซื้อในช่วงต้นของแนวโน้มขาขึ้น และสามารถวางแผนซื้อเพิ่มอย่างมีระบบเมื่อราคาเกิดการย่อในเทรนด์หลัก

แนวคิดหลักของระบบคือแบ่งการเข้าซื้อออกเป็น 2 จังหวะ

Buy1 คือสัญญาณซื้อช่วงต้นเทรนด์ ใช้เพื่อจับจุดเริ่มต้นของแนวโน้มขาขึ้น เมื่อโครงสร้างราคาเริ่มเปลี่ยนเป็นบวกและ momentum สนับสนุน เป้าหมายของ Buy1 คือการเริ่มต้นถือ position ตั้งแต่ระยะเริ่มต้นของเทรนด์ ก่อนที่ราคาเข้าสู่ช่วงเร่งตัว

Buy2 คือสัญญาณซื้อเพิ่มระหว่างทาง เมื่อราคาเกิด pullback แต่ยังคงรักษาโครงสร้างขาขึ้นไว้ โดยระบบจะมองหาจุด swing low ใหม่ที่ยกสูงกว่าสวิงโลว์ก่อนหน้า พร้อมกับ MACD ที่แสดงแรงส่งดีขึ้น สัญญาณนี้ใช้เพื่อเพิ่ม position ในช่วงย่อ โดยกำหนด Stop Loss อ้างอิงจาก EMA100 เพื่อควบคุมความเสี่ยงให้อยู่ในกรอบของเทรนด์หลัก

อีกองค์ประกอบสำคัญคือสัญญาณ “doi” ซึ่งเป็นคำแสลงในหมู่นักเล่นหุ้นไทย หมายถึงภาวะที่ซื้อบนยอดหรือไปติดอยู่บนภูเขา ในบริบทของอินดิเคเตอร์นี้ “doi” ใช้เป็นสัญญาณเตือนว่าไม่ควรเปิด order เพิ่ม หรือไม่ควรไล่ซื้อเพิ่มในจังหวะนั้น เพราะมีความเสี่ยงที่จะกลายเป็นการถือของบนยอด หากเทียบในภาษาอังกฤษ แนวคิดนี้ใกล้เคียงกับคำว่า baghold หรือ bagholding risk

ในด้านการบริหารกำไร อินดิเคเตอร์นี้ไม่ได้มอง Take Profit เป็นจุดขายออกทั้งหมดในครั้งเดียว แต่เน้นแนวคิดการทยอยแบ่งขายทำกำไร หรือ scale out ตามสภาพของราคาและ momentum เพื่อให้สามารถรักษาผลกำไรจากเทรนด์ที่กำลังวิ่ง และลดความเสี่ยงจากการขายหมดเร็วเกินไป

ระบบนี้เหมาะกับหุ้นหรือสินทรัพย์ที่มีลักษณะเคลื่อนไหวเป็นแนวโน้มชัดเจนและสามารถวิ่งต่อเนื่องได้ยาว เช่น หุ้นที่อยู่ในรอบขาขึ้นเด่น หรือสินทรัพย์ที่มี momentum ต่อเนื่อง เพราะแนวคิดของระบบอาศัยการ “เริ่มต้นถือเมื่อเทรนด์เริ่มมา” และ “เพิ่มเมื่อย่อในเทรนด์” มากกว่าการเทรดสวนทางหรือเก็งกำไรระยะสั้นในตลาด sideway
Информация о релизе
Trend Pullback Momentum System is a trend-following indicator designed to identify early entries in emerging uptrends and structured add-on entries during healthy pullbacks.

This script combines trend structure, pullback logic, and momentum confirmation into a single framework. The goal is not simply to merge indicators, but to create a step-by-step trading model for trending markets.

Core Concepts

Buy1 – Early Trend Entry
Buy1 is the initial entry signal. It is designed to detect the beginning of a bullish trend when price structure improves and momentum starts to expand. This helps traders participate early before the trend becomes obvious.
Buy2 – Pullback Add-On Entry
Buy2 is an additional entry signal during an existing uptrend. It appears when price forms a higher swing low compared to the previous swing low, while MACD also forms a higher low. This indicates that momentum is strengthening during a pullback.

To align risk with the primary trend, the Buy2 stop-loss reference is based on EMA100 at the signal bar.

Doi Warning Signal
“Doi” is a Thai trader slang term referring to buying near the top and getting trapped at high prices. In this script, doi acts as a warning signal when price creates a new swing high while MACD weakens versus the previous swing high. It suggests avoiding additional entries at extended levels.
Take Profit Logic
The script is designed around partial profit-taking rather than full exit at one target. Traders can scale out as price reaches swing highs or when momentum weakens.

How Components Work Together

EMA structure is used to define the main trend direction.
Swing highs and swing lows are used to detect pullbacks and structural continuation.
MACD is used as momentum confirmation.
Buy1 enters early trend expansion.
Buy2 adds during constructive retracements.
Doi helps avoid chasing extended moves.
TP logic helps manage exits gradually.

Best Use Cases

This script performs best on stocks, indices, commodities, or crypto assets that trend strongly over time. It is less effective in sideways or choppy markets.

How to Use

Look for Buy1 to start a position.
Use Buy2 to add during pullbacks.
Avoid adding when doi appears.
Scale out near resistance or swing highs.
Use your own risk management and position sizing.

Important Notes

This indicator is an analytical tool, not financial advice. Always test settings based on your market and timeframe.

เวอร์ชันภาษาไทย

Trend Pullback Momentum System เป็นอินดิเคเตอร์สาย Trend Following ที่ออกแบบมาเพื่อหาจังหวะเข้าซื้อช่วงต้นเทรนด์ และหาจังหวะซื้อเพิ่มเมื่อราคาย่ออย่างมีโครงสร้าง

สคริปต์นี้ไม่ได้เป็นเพียงการนำ indicator หลายตัวมารวมกัน แต่เป็นระบบที่ผสาน Trend Structure, Pullback Logic และ Momentum Confirmation เข้าด้วยกัน เพื่อใช้ในตลาดที่เป็นเทรนด์

แนวคิดหลัก

Buy1 – ซื้อช่วงต้นเทรนด์
ใช้หาจังหวะเริ่มต้นของแนวโน้มขาขึ้น เมื่อโครงสร้างราคาเริ่มแข็งแรงและ momentum เริ่มมา
Buy2 – ซื้อเพิ่มตอนย่อ
เกิดเมื่อราคาทำ Higher Low และ MACD ทำ Higher Low เช่นกัน แสดงถึงการย่อที่ยังแข็งแรงในเทรนด์หลัก โดยใช้ EMA100 เป็นจุดอ้างอิง Stop Loss
Doi Signal
“ดอย” เป็นคำแสลงนักลงทุนไทย หมายถึงซื้อบนยอดแล้วติดอยู่ด้านบน สัญญาณนี้ใช้เตือนว่าไม่ควรไล่ซื้อเพิ่ม เมื่อราคาทำจุดสูงใหม่แต่ MACD อ่อนลงจากยอดก่อนหน้า
Take Profit
เน้นการทยอยแบ่งขายทำกำไร ไม่ใช่ขายทั้งหมดในครั้งเดียว

องค์ประกอบทำงานร่วมกันอย่างไร

EMA ใช้ดูทิศทางเทรนด์
Swing High / Low ใช้ดูโครงสร้างราคา
MACD ใช้ยืนยันแรงส่ง
Buy1 ใช้เข้าต้นเทรนด์
Buy2 ใช้เพิ่มตอนย่อ
Doi ใช้กันการไล่ซื้อบนยอด
TP ใช้บริหารกำไร

เหมาะกับ

หุ้น สินค้าโภคภัณฑ์ ดัชนี หรือสินทรัพย์ที่วิ่งเป็นเทรนด์ชัดเจน
ไม่เหมาะกับตลาด Sideway มากนัก NVDA
Информация о релизе
Version Update Notes

This update improves the script with expanded bearish signals, cleaner alert logic, and faster market attention triggers. The goal of this version is to make the system more practical for real trading by helping users detect both trend opportunities and important market changes more efficiently.

What’s New

1. Sell1 Added – Early Downtrend Signal
Sell1 has been added as the bearish counterpart of Buy1. It detects the early stage of a downside trend when EMA structure turns negative and MACD confirms weakness.

2. Sell2 Added – Lower High Pullback Signal
Sell2 has been added as the bearish counterpart of Buy2. It identifies lower-high continuation structures with weakening momentum. This can be used for short opportunities, reducing long exposure, or avoiding new entries in weak markets.

3. New Sell Alerts
Alert conditions are now included for:

* Sell1
* Sell2

This allows users to react faster to bearish trend changes.

4. Trend Alignment Alerts Added
New alerts now trigger when short-term EMA structure aligns with higher-level EMA structure.

* Bullish Alignment = fastBull + slowBull
* Bearish Alignment = fastBear + slowBear

These conditions help confirm when multiple trend layers move in the same direction.

5. Combined Price Cross Alerts Added
Price cross alerts have been simplified into two cleaner signals:

* Price Cross Up EMA Mid or EMA Slow
* Price Cross Down EMA Mid or EMA Slow

These alerts are designed as attention signals to bring traders back to the chart when price interacts with important moving averages.

Why This Update Matters

This version transforms the script from a long-only trend tool into a broader market framework with:

* Bullish and bearish signals
* Better trend confirmation
* Simpler alert management
* Faster awareness of important price movement
* More practical chart monitoring

Best Use Cases

This script works best for traders who:

* Use trend-following or pullback strategies
* Trade stocks, forex, crypto, commodities, or indices
* Prefer alerts instead of watching charts all day
* Want both opportunity signals and warning signals

Notes

Sell signals may be interpreted differently depending on market type:

* Stocks: reduce exposure, exit longs, avoid adding
* Futures / Forex / Crypto: short setups or reversal trades

Always test settings based on your symbol and timeframe.

อัปเดตเวอร์ชันนี้เพิ่มความสมบูรณ์ของระบบให้ใช้งานจริงมากขึ้น โดยรองรับทั้งฝั่งขาขึ้นและขาลง พร้อมปรับระบบแจ้งเตือนให้กระชับและติดตามตลาดได้ง่ายขึ้น

สิ่งที่เพิ่มเข้ามา

• Sell1 – สัญญาณเริ่มต้นขาลง
ใช้ตรวจจับช่วงต้นของแนวโน้มลง เมื่อโครงสร้าง EMA เป็นลบและ MACD อ่อนแรง

• Sell2 – สัญญาณย่อแล้วลงต่อ
ใช้ตรวจจับจุด Lower High พร้อม momentum อ่อนลง เหมาะสำหรับ short, ลดพอร์ต หรือหลีกเลี่ยงการเปิดเพิ่ม

• Sell Alerts
เพิ่มแจ้งเตือนสำหรับ Sell1 และ Sell2

• Trend Alignment Alerts
แจ้งเตือนเมื่อ EMA ระยะสั้นและระยะใหญ่ไปทางเดียวกัน

Bullish Alignment
Bearish Alignment

• Combined Price Cross Alerts
รวมการแจ้งเตือนราคา cross EMA ให้เหลือ 2 แบบ

ราคา Cross Up EMA Mid หรือ EMA Slow
ราคา Cross Down EMA Mid หรือ EMA Slow

สรุป

เวอร์ชันนี้ช่วยให้สคริปต์ติดตามตลาดได้ครบขึ้น มีทั้งสัญญาณ Buy / Sell / Trend Confirmation / Attention Alerts เหมาะกับสาย Trend Following และ Pullback ที่ต้องการใช้ alert ช่วยเฝ้ากราฟอย่างมีระบบ
Информация о релизе
Update Version 3.0

Version 3.0 focuses on making the indicator cleaner, faster to read, and more practical for active trading and scalping. Compared with V2.0, this version reduces unnecessary labels and shifts more information into visual guidance, so the chart is less crowded and easier to follow during fast market movement. The main improvement is the addition of EMA Slow Flat Detection, which helps identify low-quality market conditions where the long-term EMA is too flat and the market may lack directional momentum. During these phases, entry labels are filtered out to reduce false signals and avoid overtrading in sideways conditions.

This version also adds MACD Histogram into the signal logic, allowing Buy/Sell conditions to respond better to real momentum instead of relying only on MACD line versus signal line. The result is a cleaner trend-following and pullback framework where signals appear only when trend structure and momentum are more aligned. Weak momentum candles are highlighted visually, helping traders quickly recognize when price is still above or below the main trend line but momentum is not supporting continuation.

The overall concept of V3.0 is to reduce cognitive load. Instead of showing too many labels, the script now uses cleaner graphic cues such as EMA flat overlay, weak momentum candle color, simplified alerts, and filtered entry signals. This makes the screen easier to scan and helps traders stay focused on the important market phases: trend, pullback, weak momentum, and no-trade conditions. It is especially useful for scalping or short-term trend-following, where a clean chart and fast visual recognition matter more than having too many signals on screen.

Отказ от ответственности

Информация и публикации не предназначены для предоставления и не являются финансовыми, инвестиционными, торговыми или другими видами советов или рекомендаций, предоставленных или одобренных TradingView. Подробнее читайте в Условиях использования.