Thermal Expansion Wave VDUB_v1

374 0 27
*** Modified, Madrid Ma Ribbon, Mashup. Using three colours indicating thermal expansion zones using Hull ma for the pivot points .
Remove from Favorite Scripts Add to Favorite Scripts
//Modified Madrid MA ribbon///// 
study("Thermal Expansion Wave VDUB_v1", overlay=true, shorttitle="TEW_V1")
src = input(close, type="source")
fastLen = input(55, minval=1)
slowLen = input(1, minval=1)
ema = input(true, title="Exponential")
maColor(ma) =>change(ma,3)>=0?lime:red
fastMA = ema?ema(src, fastLen):sma(src, fastLen)
slowMA = ema?wma(src, slowLen):wma(src, slowLen)
fastUT = plot(fastMA>=slowMA?fastMA:na, color=maColor(fastMA), style=linebr, linewidth=4)
slowUT = plot(fastMA>=slowMA?slowMA:na, color=maColor(slowMA), style=linebr,linewidth=4)
fill(fastUT, slowUT, color=yellow, transp=1)

fastDT = plot(fastMA<slowMA?fastMA:na, color=maColor(fastMA), style=linebr,linewidth=4)
slowDT = plot(fastMA<slowMA?slowMA:na, color=maColor(slowMA), style=linebr,linewidth=4)
fill(fastDT, slowDT, color=lime, transp=1)
src2 = input(close, type="source")
fastLen2 = input(55, minval=1)
slowLen2 = input(9, minval=1)
ema2 = input(true, title="Exponential")
maColor2(ma) =>change(ma,3)>=0?black:black
fastMA2 = ema2?ema(src2, fastLen2):sma(src2, fastLen2)
slowMA2 = ema2?ema(src2, slowLen2):ema(src2, slowLen2)
fastUT2 = plot(fastMA2>=slowMA2?fastMA2:na, color=maColor(fastMA2), style=linebr, linewidth=1)
slowUT2 = plot(fastMA2>=slowMA2?slowMA2:na, color=maColor(slowMA2), style=linebr,linewidth=1)
fill(fastUT2, slowUT2, color=blue, transp=60)

fastDT2 = plot(fastMA2<slowMA2?fastMA2:na, color=maColor(fastMA2), style=linebr,linewidth=1)
slowDT2 = plot(fastMA2<slowMA2?slowMA2:na, color=maColor(slowMA2), style=linebr,linewidth=1)
fill(fastDT2, slowDT2, color=blue, transp=60)
src3 = input(close, type="source")
fastLen3 = input(55, minval=1)
slowLen3 = input(24, minval=1)
ema3 = input(true, title="Exponential")
maColor3(ma) =>change(ma,3)>=0?black:black
fastMA3 = ema3?ema(src, fastLen3):sma(src3, fastLen3)
slowMA3 = ema3?wma(src, slowLen3):wma(src3, slowLen3)
fastUT3 = plot(fastMA3>=slowMA3?fastMA3:na, color=maColor3(fastMA3), style=linebr, linewidth=1)
slowUT3 = plot(fastMA3>=slowMA3?slowMA3:na, color=maColor3(slowMA3), style=linebr,linewidth=1)
fill(fastUT3, slowUT3, color=black, transp=1)

fastDT3 = plot(fastMA3<slowMA3?fastMA3:na, color=maColor3(fastMA3), style=linebr,linewidth=1)
slowDT3 = plot(fastMA3<slowMA3?slowMA3:na, color=maColor3(slowMA3), style=linebr,linewidth=1)
fill(fastDT3, slowDT3, color=black, transp=1)
//=============Hull MA//
show_hma = input(true, title="Display Hull MA Set:")
hma_src = input(close, title="Hull MA's Source:")
hma_base_length = input(1, minval=1, title="Hull MA's Base Length:")
hma_length_scalar = input(6, minval=0, title="Hull MA's Length Scalar:")
hullma(src, length)=>wma(2*wma(src, length/2)-wma(src, length), round(sqrt(length)))
plot(not show_hma ? na : hullma(hma_src, hma_base_length+hma_length_scalar*6), color=black, linewidth=4, title="Hull MA 7:")
Ideas Scripts Chart
United States
United Kingdom
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Billing Sign Out