OPEN-SOURCE SCRIPT
已更新 MA Trend Score

A Trend Score Indicator inspired by an interview by Navy Ramavat, where I liked the idea presented and decided to publish a script for it.
Disclaimer: I am not associated with Navy Ramavat in any manner.
The goal is to objectify the trend of an instrument and calculate a score which represents the trend strength and direction.
The score is calculated as follows:
The highest score can be 6, and lowest score can be -6
The trend score can be used as per your discretion on the long and short side.
An example of using the trend score on the long side for position sizing is:
Disclaimer: I am not associated with Navy Ramavat in any manner.
The goal is to objectify the trend of an instrument and calculate a score which represents the trend strength and direction.
The score is calculated as follows:
- If price is > EMA 20 add 1 to the score
- If price is > EMA 50 add 1 to the score
- If price is > EMA 100 add 1 to the score
- If EMA 20 is > EMA 50 add 1 to the score
- If EMA 20 is > EMA 100 add 1 to the score
- If EMA 50 is > EMA 100 add 1 to the score
- If EMA 20 is < EMA 50 deduct 1 from the score
- If EMA 20 is < EMA 100 deduct 1 from the score
- If EMA 50 is < EMA 100 deduct 1 from the score
The highest score can be 6, and lowest score can be -6
The trend score can be used as per your discretion on the long and short side.
An example of using the trend score on the long side for position sizing is:
- 100% position size if Score greater than 4
- 75% position size if Score between 2-4
- 50% position size if Score between 0-2
- 25% position size if Score between 0 and -2
- 0% position size if Score is less than -2
版本注释
Added an option to display the trend scrore above each candle, so that users can study how the score has changed over time.I typically use this trend score with the position sizing mentioned earlier, on broad indices to determine the current state of the market. Depending on the market, I make a decision on the direction of my trade (long/short) and how aggressive to trade.
版本注释
The MA Trend Score Indicator provides a compact visual summary of market trend strength by evaluating how price behaves relative to multiple moving averages (MAs) and their alignment with one another.🔍 What’s New in This Version:
Long-Term Perspective Added:
A 4th customizable moving average has been introduced to capture long-term trend direction, enhancing the earlier combination of near-term, short-term, and medium-term signals.
Improved Scoring Logic:
The visual score representation is now color-coded more intuitively:
- Green for strong bullish alignment (score = 10)
- Yellow for moderately bullish setups (score ≥ 4)
- Orange for neutral/weak trends
- Red for bearish alignment
Custom MA Colors:
Each moving average line now supports user-defined colors, to cater to personal preferences.
📊 How It Works:
The indicator assigns a trend score ranging from -10 to +10, calculated by:
- Checking whether price is above or below each MA (up to 4 MAs)
- Evaluating the relative order of the MAs (bullish stack gets more points)
This score is:
- Displayed in a table on the chart (position configurable)
- Optionally shown above candles as compact labels, with performance-optimized label management
📈 Use Cases:
- Trend confirmation tool for directional bias
- Entry/exit timing based on strength of MA alignment
I personally use this indicator to objectively determine market regime using a relevant Index, and adjust my position-sizes up or down based on the trend score.
版本注释
fixed a bug with the MA colours开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。
开源脚本
本着TradingView的真正精神,此脚本的创建者将其开源,以便交易者可以查看和验证其功能。向作者致敬!虽然您可以免费使用它,但请记住,重新发布代码必须遵守我们的网站规则。
免责声明
这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。