Leading Cloud-Based Momentum Indicator:
- Above Orange Line => uptrend
- Below Orange Line => downtrend
- Cloud breakout => strong trend confirmation
This indicator can also be used for mean reversion trading.
thinkScript Code
Code:
# Cloudy Momentum
# Assembled by BenTen at useThinkScript.com
# Converted from https://raw.githubusercontent.com/f13end/tradingview-custom-indicators/master/indicators/CloudyMomentum.pine
input length = 26;
input emaLength = 55;
def lower = lowest(close, length) - (highest(close, length) - lowest(close, length)) * 0.618;
def upper = highest(close, length) + (highest(close, length) - lowest(close, length)) * 0.618;
def lowerEMA = expAverage(lower, emaLength);
def upperEMA = expAverage(upper, emaLength);
def basis = (lowerEMA + upperEMA) / 2;
plot lower_band = lowerEMA;
plot upper_band = upperEMA;
plot middle = basis;
AddCloud(upper_band, lower_band, color.gray, color.gray);
upper_band.SetDefaultColor(GetColor(1));
lower_band.SetDefaultColor(GetColor(0));
middle.SetDefaultColor(GetColor(4));