Cloudy Momentum Bands for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
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));
 
J

john3

Active member
2019 Donor
Warehouse
@BenTen Very interesting, thank you!

Would you please explain in plain English what this code is doing?
 
BenTen

BenTen

Administrative
Staff
VIP
@john3 It's similar to the Bollinger Bands.
 
horserider

horserider

Well-known member
VIP
@john3 Looks like a price channel. Different calculations than BB. From charts shown look for reversals when price leaves the outer bands.
 

Top