OPEN-SOURCE SCRIPT
Updated Sigmoidal Candle Count Risk (SCCR)

Sigmoidal Candle Count Risk (SCCR)
This indicator is designed to identify potential reversal levels based on the number of consecutive candles moving in the same direction. Its core premise is based on the sequence of consecutive candles moving in uniform. The assumption is that an increasing sequence of consecutive candles heightens the likelihood of a reversal.
Functionality:
Pine Script®
Pine Script®
This indicator is designed to identify potential reversal levels based on the number of consecutive candles moving in the same direction. Its core premise is based on the sequence of consecutive candles moving in uniform. The assumption is that an increasing sequence of consecutive candles heightens the likelihood of a reversal.
Functionality:
- It uses the sigmoid function to translate the difference between bullish (upward) and bearish (downward) candle counts into a risk value ranging from 0 (low risk, bullish sentiment) to 1 (high risk, bearish sentiment)
1/(1+math.exp(-((usum+dsum)/2)))
- Additionally, it uses a symmetrically weighted moving average for smoothing.
ta.swma()
Release Notes
Made a mistake in the previous description. Here is the corrected sigmoid function:1/(1+math.exp(-(usum-dsum)))
Also updated the RiskMeasure() parameters from close>open,open>close to close>close[1],close[1]>close to better reflect increases/decreases in price.
Release Notes
Added a timeframe option. Larger timeframe readings tend to provide more probable setups.Release Notes
Changed scale from 0-1 to 0-100 and added middle line.Release Notes
General script clean up, visual updates, and added description in the script.Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.