OPEN-SOURCE SCRIPT
Trend Score For Loop | NickJoan

Trend Score For Loop is a trend-classification indicator that evaluates the current source relative to a defined range of prior bars using a loop-based scoring process. The resulting score is compared against user-defined threshold levels to identify bullish and bearish state shifts, while the indicator simultaneously colors price candles to reflect the active directional bias.
Methodology
The indicator calculates a cumulative score by comparing the current source value to each historical value between the selected Start and End lookback points. A positive comparison contributes to upward bias, while a negative comparison contributes to downward bias, producing a simple but adaptive measure of directional strength across the selected range.
Signal logic
A bullish state is established when the score exceeds the Long Threshold, while a bearish state is established when the score falls below the Short Threshold. Once a state is confirmed, it remains active until an opposing threshold condition is triggered, allowing the indicator to behave as a persistent market-bias filter.
Visual output
The script plots the trend score in a separate pane and applies color-coded candle overlays on the main chart to improve visual interpretation of the active state.
Methodology
The indicator calculates a cumulative score by comparing the current source value to each historical value between the selected Start and End lookback points. A positive comparison contributes to upward bias, while a negative comparison contributes to downward bias, producing a simple but adaptive measure of directional strength across the selected range.
Signal logic
A bullish state is established when the score exceeds the Long Threshold, while a bearish state is established when the score falls below the Short Threshold. Once a state is confirmed, it remains active until an opposing threshold condition is triggered, allowing the indicator to behave as a persistent market-bias filter.
Visual output
The script plots the trend score in a separate pane and applies color-coded candle overlays on the main chart to improve visual interpretation of the active state.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.
Open-source Skript
Ganz im Sinne von TradingView hat dieser Autor sein/ihr Script als Open-Source veröffentlicht. Auf diese Weise können nun auch andere Trader das Script rezensieren und die Funktionalität überprüfen. Vielen Dank an den Autor! Sie können das Script kostenlos verwenden, aber eine Wiederveröffentlichung des Codes unterliegt unseren Hausregeln.
Haftungsausschluss
Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.