Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- study("Fisher and Cross")
- // Fisher Transform and Crosses, Rev 01
- // Junk Still - Working Copy
- // https://getsatisfaction.com/tradingview/topics/seeking_script_writer_to_enhance_a_current_indicator
- //
- // Rewrite for Tradingview "Pine Script" by Kocurekc, April 2014
- // https://getsatisfaction.com/tradingview/
- // https://www.tradingview.com/u/kocurekc/
- // Code is provided as public domain, no warranty
- LB = input(title="Lookback Period", type=integer, defval=31, minval=2)
- //SO = input(title="Signal Offset Factor", type=float, defval=0.20, minval=0.01)
- IT = input(title="Input Threshold", type=float, defval=1.50, minval=0.01)
- Value1 = (0.33*2)*((hl2 - lowest(low, LB))/(highest(high, LB) - lowest(low, LB)) - 0.5) + 0.6667*(nz(Value1[1]))
- Value2 = Value1 > 0.99 ? 0.999 : Value1 < -0.99 ? -0.999 : Value1
- Fisher = 0.5 * log((1+Value2)/(1-Value2)) + 0.5 * nz(Fisher[1])
- Trigger = nz(Fisher[1])
- plot(Fisher, style=histogram, color=red)
- plot(Trigger, color=black)
- trendDown = Fisher < Fisher[1] ? Fisher[1] > Fisher[2] ? Fisher[1] >= IT ? -1 : 0 : 0 : 0
- trendUp = Fisher > Fisher[1] ? Fisher[1] < Fisher[2] ? Fisher[1] <= -IT ? 1 : 0 : 0 : 0
- plot(trendUp, style=columns, color=green)
- plot(trendDown, style=columns, color=red)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement