TTM Wave ABC By GanymedeNil
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ganymedenil

//@version=5
indicator("TTM Wave ABC By GanymedeNil")

showA = input.bool(true,"Show TTM Wave A")
showB = input.bool(false,"Show TTM Wave B")
showC = input.bool(false,"Show TTM Wave C")


// A
float ttmwas = na
float ttmwaf = na
if showA 
    [_,_,ASlowHist] = ta.macd(close,8,55,55)
    ttmwas := ASlowHist
    [_,_,AFastHist] = ta.macd(close,8,34,34)
    ttmwaf := AFastHist
plot(ttmwas,style=plot.style_histogram,title="TTM wave A Slow",color=#296a22,linewidth=3)
plot(ttmwaf,style=plot.style_histogram,title="TTM wave A Fast",color=#f3701c,linewidth=3)

// B
float ttmwbs = na
float ttmwbf = na
if showB
    [_,_,BSlowHist] = ta.macd(close,8,144,144)
    ttmwbs := BSlowHist
    [_,_,BFastHist] = ta.macd(close,8,89,89)
    ttmwbf := BFastHist
plot(ttmwbs,style=plot.style_histogram,title="TTM wave B Slow",color=#296a22,linewidth=3)
plot(ttmwbf,style=plot.style_histogram,title="TTM wave B Fast",color=#f3701c,linewidth=3)

// C
float ttmwcmacd = na
float ttmwcf = na
if showC
    [Cmacd,_,CSlowHist] = ta.macd(close,8,377,377)
    ttmwcmacd := Cmacd
    [_,_,CFastHist] = ta.macd(close,8,233,233)
    ttmwcf := CFastHist
plot(ttmwcmacd,style=plot.style_histogram,title="TTM wave C Macd",color=#296a22,linewidth=3)
plot(ttmwcf,style=plot.style_histogram,title="TTM wave C Fast",color=#f3701c,linewidth=3)