Professional Documents
Culture Documents
The Indian Trader V 4.0
The Indian Trader V 4.0
calcx()=>
bufferDn= high + Multiplier * wma(tr,ATR)
bufferUp= low - Multiplier * wma(tr,ATR)
if (thisCCI >= 0 and lastCCI < 0)
bufferUp := bufferDn[1]
if (thisCCI <= 0 and lastCCI > 0)
bufferDn := bufferUp[1]
if (thisCCI >= 0)
if (bufferUp < bufferUp[1])
bufferUp := bufferUp[1]
else
if (thisCCI <= 0)
if (bufferDn > bufferDn[1])
bufferDn := bufferDn[1]
x = 0.0
x := thisCCI >= 0 ?bufferUp:thisCCI <= 0 ?bufferDn: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.yellow:color.blue
swap3=thisCCI >=0 ?color.yellow:color.blue
swap4=original?swap3:swap2
plot(htfx,color=htfswap4,transp=0,linewidth=3)