Advertisement
Guest User

Untitled

a guest
Jun 8th, 2017
39
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.15 KB | None | 0 0
  1. study(title="Fisher Transform", shorttitle="multi_fisher")
  2.  
  3. //Fisher34
  4. len34 = input(34, minval=1, title="Length")
  5. high_34 = highest(hl2, len34)
  6. low_34 = lowest(hl2, len34)
  7. rounda_(val34) => val34 > .99 ? .999 : val34 < -.99 ? -.999 : val34
  8. value34 = rounda_(.66 * ((hl2 - low_34) / max(high_34 - low_34, .001) - .5) + .67 * nz(value34[1]))
  9. fisha34 = .5 * log((1 + value34) / max(1 - value34, .001)) + .5 * nz(fisha34[1])
  10. fishb34 = fisha34[1]
  11.  
  12. //Fisher100
  13. len100 = input(89, minval=1, title="Length")
  14. high_100 = highest(hl2, len100)
  15. low_100 = lowest(hl2, len100)
  16. roundb_(val100) => val100 > .99 ? .999 : val100 < -.99 ? -.999 : val100
  17. value100 = roundb_(.66 * ((hl2 - low_100) / max(high_100 - low_100, .001) - .5) + .67 * nz(value100[1]))
  18. fisha100 = .5 * log((1 + value100) / max(1 - value100, .001)) + .5 * nz(fisha100[1])
  19. fishb100 = fisha100[1]
  20.  
  21. //Fisher200
  22. len200 = input(233, minval=1, title="Length")
  23. high_200 = highest(hl2, len200)
  24. low_200 = lowest(hl2, len200)
  25. roundc_(val200) => val200 > .99 ? .999 : val200 < -.99 ? -.999 : val200
  26. value200 = roundc_(.66 * ((hl2 - low_200) / max(high_200 - low_200, .001) - .5) + .67 * nz(value200[1]))
  27. fisha200 = .5 * log((1 + value200) / max(1 - value200, .001)) + .5 * nz(fisha200[1])
  28. fishb200 = fisha200[1]
  29.  
  30.  
  31. //
  32. circleYPosition = fisha34
  33. circle_color= crossover(fisha34,fishb34)?green:crossunder(fisha34,fishb34)?red:na
  34. plot(cross(fisha34, fishb34) ? circleYPosition : na, title="Cross", style=circles, linewidth=4, color=circle_color)
  35.  
  36. circleYPosition1 = fisha100
  37. circle_color1= crossover(fisha100,fishb100)?green:crossunder(fisha100,fishb100)?red:na
  38. //plot(cross(fisha100, fishb100) ? circleYPosition1 : na, title="Cross", style=circles, linewidth=4, color=circle_color1)
  39.  
  40. circleYPosition2 = fisha200
  41. circle_color2= crossover(fisha200,fishb200)?green:crossunder(fisha200,fishb200)?red:na
  42. //plot(cross(fisha200, fishb200) ? circleYPosition2 : na, title="Cross", style=circles, linewidth=4, color=circle_color2)
  43.  
  44. 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
  45. 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
  46. alertcondition(cxs==1 , message="Fisher BUY", title="Fisher BUY")
  47. alertcondition(cxs==-1 , message="Fisher SELL", title="Fisher SELL")
  48. bgcolor(cxc,45)
  49. //
  50. plot(fisha34, color=blue, title="Fisher34")
  51. plot(fishb34,color=green, title="fisher34_trig")
  52. plot(fisha100, color=purple, title="fisher100")
  53. //plot(fishb100, color=purple, title="fisher100_trig")
  54. plot(fisha200, color=black, title="fisher200")
  55. //plot(fishb200, color=black, title="fisher200_trig")
  56. hline(0,color=white)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement