Professional Documents
Culture Documents
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
if (thisCCI >= 0)
if (Up < Up[1])
Up := Up[1]
else
if (thisCCI <= 0)
if (Dn > Dn[1])
Dn := Dn[1]
x = 0.0
x := thisCCI >= 0 ?Up:thisCCI <= 0 ?Dn:x[1]
x
tempx = calcx()
calcswap() =>
swap = 0.0
swap := tempx>tempx[1]?1:tempx<tempx[1]?-1:swap[1]
swap
tempswap = calcswap()
swap2=tempswap==1?color.green:color.purple
swap3=thisCCI >=0 ?color.green:color.purple
swap4=original?swap3:swap2
//display current timeframe's Trend
//plot(tempx,color=swap4,transp=0,linewidth=4)
plot(htfx,color=htfswap4,transp=0,linewidth=5,title="Main Trend")