Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- study(title="Fisher Transform", shorttitle="multi_fisher")
- //Fisher34
- len34 = input(34, minval=1, title="Length")
- high_34 = highest(hl2, len34)
- low_34 = lowest(hl2, len34)
- rounda_(val34) => val34 > .99 ? .999 : val34 < -.99 ? -.999 : val34
- value34 = rounda_(.66 * ((hl2 - low_34) / max(high_34 - low_34, .001) - .5) + .67 * nz(value34[1]))
- fisha34 = .5 * log((1 + value34) / max(1 - value34, .001)) + .5 * nz(fisha34[1])
- fishb34 = fisha34[1]
- //Fisher100
- len100 = input(89, minval=1, title="Length")
- high_100 = highest(hl2, len100)
- low_100 = lowest(hl2, len100)
- roundb_(val100) => val100 > .99 ? .999 : val100 < -.99 ? -.999 : val100
- value100 = roundb_(.66 * ((hl2 - low_100) / max(high_100 - low_100, .001) - .5) + .67 * nz(value100[1]))
- fisha100 = .5 * log((1 + value100) / max(1 - value100, .001)) + .5 * nz(fisha100[1])
- fishb100 = fisha100[1]
- //Fisher200
- len200 = input(233, minval=1, title="Length")
- high_200 = highest(hl2, len200)
- low_200 = lowest(hl2, len200)
- roundc_(val200) => val200 > .99 ? .999 : val200 < -.99 ? -.999 : val200
- value200 = roundc_(.66 * ((hl2 - low_200) / max(high_200 - low_200, .001) - .5) + .67 * nz(value200[1]))
- fisha200 = .5 * log((1 + value200) / max(1 - value200, .001)) + .5 * nz(fisha200[1])
- fishb200 = fisha200[1]
- //
- circleYPosition = fisha34
- circle_color= crossover(fisha34,fishb34)?green:crossunder(fisha34,fishb34)?red:na
- plot(cross(fisha34, fishb34) ? circleYPosition : na, title="Cross", style=circles, linewidth=4, color=circle_color)
- circleYPosition1 = fisha100
- circle_color1= crossover(fisha100,fishb100)?green:crossunder(fisha100,fishb100)?red:na
- //plot(cross(fisha100, fishb100) ? circleYPosition1 : na, title="Cross", style=circles, linewidth=4, color=circle_color1)
- circleYPosition2 = fisha200
- circle_color2= crossover(fisha200,fishb200)?green:crossunder(fisha200,fishb200)?red:na
- //plot(cross(fisha200, fishb200) ? circleYPosition2 : na, title="Cross", style=circles, linewidth=4, color=circle_color2)
- cxc= (crossover(fisha34,0)) and fisha34>fishb34 and fisha100>fishb100 and fisha200>fishb200 and fisha34[1]>fishb34[1] and fisha100[1]>fishb100[1] and fisha200[1]>fishb200[1] ? aqua : (crossunder(fisha34,0)) and fisha34<fishb34 and fisha100<fishb100 and fisha200<fishb200 and fisha34[1]<fishb34[1] and fisha100[1]<fishb100[1] and fisha200[1]<fishb200[1]? fuchsia : na
- cxs= (crossover(fisha34,0)) and fisha34>fishb34 and fisha100>fishb100 and fisha200>fishb200 and fisha34[1]>fishb34[1] and fisha100[1]>fishb100[1] and fisha200[1]>fishb200[1] ? 1 : (crossunder(fisha34,0)) and fisha34<fishb34 and fisha100<fishb100 and fisha200<fishb200 and fisha34[1]<fishb34[1] and fisha100[1]<fishb100[1] and fisha200[1]<fishb200[1]? -1 : na
- alertcondition(cxs==1 , message="Fisher BUY", title="Fisher BUY")
- alertcondition(cxs==-1 , message="Fisher SELL", title="Fisher SELL")
- bgcolor(cxc,45)
- //
- plot(fisha34, color=blue, title="Fisher34")
- plot(fishb34,color=green, title="fisher34_trig")
- plot(fisha100, color=purple, title="fisher100")
- //plot(fishb100, color=purple, title="fisher100_trig")
- plot(fisha200, color=black, title="fisher200")
- //plot(fishb200, color=black, title="fisher200_trig")
- hline(0,color=white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement