'RocketRSI by John Ehlers (EhlersRocketRSI)
'Adapated for Omnilanguage by Manfred on 10 January 2019
'References:
'http://traders.com/Documentation/FEEDbk_docs/2018/05/TradersTips.html
'"In RocketRSIâ€”A Solid Propellant For Your Rocket Science Trading - a May 2018 S&C article, author John Ehlers introduces a new take on the classic RSI indicator originally
'developed by J. Welles Wilder. Ehlers begins by introducing a new version of the RSI based on a simple accumulation of up and down closes rather than averages.
'To this he applies a Fisher transform. He tells us that the resultant output is statistically significant spikes that indicate cyclic turning points with precision."
'https://www.prorealcode.com/prorealtime-indicators/rocketrsi-john-ehlers/
'For a trading system the suggested approach is Buy Long at Market when RocketRSI crosses below -OBOSLevel (2) and Sell Short when RocketRSI crosses above OBOSLevel(2)
'From others' analysis it the use of an N-bar stop may have merit; also it may be worth investigating Sell Short when RocketRSI crosses below OBOSLevel (2) for greater profitability.
#Indicator
#Param "SmoothLength",10,2,50 'default = 10
#Param "RSILength",10,2,50 'default = 10
#Param "OBOSLevel",2,2,2 'default = 2
Dim a1, b1, c1, c2, c3, Mom1, Filt as Single
Dim CU, CD, MyRSI, RocketRSI as Single
Dim count as Integer
'Compute Super Smoother coefficients once
If Bar = 1 Then
a1 = exp( -1.414 * 3.14159/ ( SmoothLength ) )
b1 = 2 * a1 * Cos( 1.414 * 180/ ( SmoothLength ) )
c2 = b1
c3 = -(a1)^2
c1 = 1 - c2 - c3
End If
If Bar > RSILength Then
'Create half dominant cycle Momentum
Mom1 = Close - Close[RSILength - 1] 'Mom = Close - Ref( Close, RSILength - 1 )
'SuperSmoother Filter
Filt = c1 * ( Mom1 + Mom1[1] ) / 2 + c2 * Filt[1] + c3 * Filt[2]
'Accumulate "Closes Up" and "Closes Down"
CU = 0
CD = 0
For count = 0 to RSILength -1
If Filt[count] - Filt[count + 1] > 0 Then
CU = CU + Filt[count] - Filt[count + 1]
End If
If Filt[count] - Filt[count + 1] < 0 Then
CD = CD + Filt[count + 1] - Filt[count]
End If
Next count
If CU + CD <> 0 Then
MyRSI = (CU - CD) / (CU + CD)
End If
'Limit RocketRSI output to +- 3 Standard Deviations
If MyRSI > .999 Then
MyRSI = .999
End If
If MyRSI < -.999 Then
MyRSI = -.999
End If
'Apply Fisher Transform to establish Gaussian Probability Distribution
RocketRSI = .5 * LOG((1+MyRSI) / (1-MyRSI))
End If
SetScales(-OBOSLevel-2,OBOSLevel+2)
PlotLabel(0)
PlotLabel(OBOSLevel)
PlotLabel(-OBOSLevel)
If RocketRSI > OBOSLevel Then
Plot ("RocketRSI",RocketRSI,Red,2)
Else If RocketRSI < -OBOSLevel Then
Plot ("RocketRSI",RocketRSI,LimeGreen,2)
Else
Plot ("RocketRSI",RocketRSI,LightSlateGray,2)
End If
Return RocketRSI