OPEN-SOURCE SCRIPT
TSM + ADX Trend Power

Logic Behind This Indicator
This indicator combines two momentum/trend tools to identify strong, reliable trends in price movement:
1. TSM (Time Series Momentum)
What it does: Measures the difference between the current price and a smoothed average of past prices.
Formula: EMA(close - EMA(close, 14), 14)
Logic:
If TSM > 0 → Price is above its recent average = upward momentum
If TSM < 0 → Price is below its recent average = downward momentum
2. ADX (Average Directional Index)
What it does: Measures trend strength (not direction).
Logic:
ADX > 25 → Strong trend (either up or down)
ADX < 25 → Weak or no trend (choppy/sideways market)
Combined Logic (TSM + ADX)
The indicator only signals a trend when both conditions are met:
Condition Meaning
Uptrend TSM > 0 AND ADX > 25 → Strong upward momentum
Downtrend TSM < 0 AND ADX > 25 → Strong downward momentum
No signal ADX < 25 → Trend is too weak to trust
What It Aims to Detect
This indicator combines two momentum/trend tools to identify strong, reliable trends in price movement:
1. TSM (Time Series Momentum)
What it does: Measures the difference between the current price and a smoothed average of past prices.
Formula: EMA(close - EMA(close, 14), 14)
Logic:
If TSM > 0 → Price is above its recent average = upward momentum
If TSM < 0 → Price is below its recent average = downward momentum
2. ADX (Average Directional Index)
What it does: Measures trend strength (not direction).
Logic:
ADX > 25 → Strong trend (either up or down)
ADX < 25 → Weak or no trend (choppy/sideways market)
Combined Logic (TSM + ADX)
The indicator only signals a trend when both conditions are met:
Condition Meaning
Uptrend TSM > 0 AND ADX > 25 → Strong upward momentum
Downtrend TSM < 0 AND ADX > 25 → Strong downward momentum
No signal ADX < 25 → Trend is too weak to trust
What It Aims to Detect
- Strong, sustained trends (not just noise or small moves)
- Filters out weak/choppy markets where momentum indicators often give false signals
- Entry/exit points:
- Green background = Strong uptrend (consider buying/holding)
- Red background = Strong downtrend (consider selling/shorting)
- No color = Weak trend (stay out or wait)
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, người tạo ra tập lệnh này đã biến tập lệnh thành mã nguồn mở để các nhà giao dịch có thể xem xét và xác minh công năng. Xin dành lời khen tặng cho tác giả! Mặc dù bạn có thể sử dụng miễn phí, nhưng lưu ý nếu đăng lại mã, bạn phải tuân theo Quy tắc nội bộ của chúng tôi.
Thông báo miễn trừ trách nhiệm
Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.