Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
- // © dotradingwithtrend
- //@version=4
- study(title="Fisher Transform_(COLOR)", shorttitle="#dotradingwithtrend", format=format.price, precision=2, resolution="")
- len = input(10, minval=1, title="Length")
- high_ = highest(hl2, len)
- low_ = lowest(hl2, len)
- round_(val) => val > .99 ? .999 : val < -.99 ? -.999 : val
- value = 0.0
- value := round_(.66 * ((hl2 - low_) / max(high_ - low_, .001) - .5) + .67 * nz(value[1]))
- fish1 = 0.0
- fish1 := .5 * log((1 + value) / max(1 - value, .001)) + .5 * nz(fish1[1])
- fish2 = fish1[1]
- hline(1.5, "1.5", color=#FFC5B5)
- hline(0.75, "0.75", color=#C6C6C6)
- hline(-0.75, "-0.75", color=#C6C6C6)
- hline(-1.5, "-1.5", color=#FFC5B5)
- col1 = fish1 > fish2 ? #36f30c : fish1 < fish2 ? #ff0707 : color.yellow
- plot(fish1, color=col1, style=hline.style_solid, linewidth=3, title="Fisher")
- plot(fish2, color=color.aqua, style=hline.style_solid, linewidth=2, title="Trigger")
- plot(0, "0", color=col1, linewidth=2)
Advertisement
Add Comment
Please, Sign In to add comment