Reverse Engineering RSI for Amibroker (AFL)
TechTradeRookie about 15 years ago Amibroker (AFL)
Derived and coded in accordance with Constance Brown’s ‘Technical Analysis for the trading professional’.
Bullsupport and Bearresistance can be adjusted and directly plotted in candlestick chart. You now know exactly what close the next bar has to make in order to reach the specified RSI-values.
Have fun!
Screenshots
Indicator / Formula
Value1 = Param("RSI BearResistance", 60, 1, 100, 0.1 );
Value2 = Param("RSI BullSupport", 40, 1, 100, 0.1 );
WildPer = Param("Time periods", 14, 1, 100 );
ExpPer = 2 * WildPer - 1;
AUC = EMA( Max( C - Ref( C, -1 ), 0 ), ExpPer );
ADC = EMA( Max( Ref( C, -1 ) - C, 0 ), ExpPer );
x1 = (WildPer - 1) * ( ADC * Value1 / (100-Value1) - AUC);
RevEngRSI1 = IIf( x1 >= 0, C + x1, C + x1 * (100-Value1)/Value1 );
x2 = (WildPer - 1) * ( ADC * Value2 / (100-Value2) - AUC);
RevEngRSI2 = IIf( x2 >= 0, C + x2, C + x2 * (100-Value2)/Value2 );
Plot( Close, Date()+", Close ", colorWhite, styleCandle );
Plot( RevEngRSI1, "RSIBearResistance( "+WriteVal(WildPer,1.0)+", "+ WriteVal(Value1, 1.2)+" )", colorRed );
Plot( RevEngRSI2, "RSIBullSupport( "+WriteVal(WildPer,1.0)+", "+ WriteVal(Value2, 1.2)+" )", colorGreen );3 comments
Leave Comment
Please login here to leave a comment.
EXCELLENT STUFF!
Thanks for sharing.
best afl…..
…you’re very welcome!