xmd79

Fisher Transform_(COLOR)

Sep 25th, 2021
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
  2. // © dotradingwithtrend
  3.  
  4.  
  5. //@version=4
  6. study(title="Fisher Transform_(COLOR)", shorttitle="#dotradingwithtrend", format=format.price, precision=2, resolution="")
  7. len = input(10, minval=1, title="Length")
  8.  
  9. high_ = highest(hl2, len)
  10. low_ = lowest(hl2, len)
  11.  
  12. round_(val) => val > .99 ? .999 : val < -.99 ? -.999 : val
  13.  
  14. value = 0.0
  15. value := round_(.66 * ((hl2 - low_) / max(high_ - low_, .001) - .5) + .67 * nz(value[1]))
  16.  
  17. fish1 = 0.0
  18. fish1 := .5 * log((1 + value) / max(1 - value, .001)) + .5 * nz(fish1[1])
  19.  
  20. fish2 = fish1[1]
  21.  
  22. hline(1.5, "1.5", color=#FFC5B5)
  23. hline(0.75, "0.75", color=#C6C6C6)
  24.  
  25. hline(-0.75, "-0.75", color=#C6C6C6)
  26. hline(-1.5, "-1.5", color=#FFC5B5)
  27.  
  28. col1 = fish1 > fish2 ? #36f30c : fish1 < fish2 ? #ff0707 : color.yellow
  29. plot(fish1, color=col1, style=hline.style_solid, linewidth=3, title="Fisher")
  30. plot(fish2, color=color.aqua, style=hline.style_solid, linewidth=2, title="Trigger")
  31. plot(0, "0", color=col1, linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment