Sharing this version of the RSI Inverse Fisher Transform - Inverse of arctanh(x). If this was previously posted, my apologies. I searched and did not find a copy other than the one I shared to be included on a different indicator.
This RSI IFT gives buy and sell signals (although the sell signals are a little late). This can be used stand alone or with other indicators to add additional confirmation in either direction.
Of course, feel free to modify as you wish.
Quick Notes
https://www.mesasoftware.com/papers/TheInverseFisherTransform.pdf
https://www.mql5.com/en/articles/303
UPDATE!!!!!!!!!!
Upper Strategy Indicator v1.0
Per request - here is a strategy version of the RSI_IFT. I've included the following
Please remember to save as a strategy and not study!
Thx!
This RSI IFT gives buy and sell signals (although the sell signals are a little late). This can be used stand alone or with other indicators to add additional confirmation in either direction.
Of course, feel free to modify as you wish.
Quick Notes
- Calculation is based on 5 period RSI then an average
- Candle color option is included and takes into account if instrument is in a squeeze or not
- On/off setting
https://www.mesasoftware.com/papers/TheInverseFisherTransform.pdf
https://www.mql5.com/en/articles/303
Ruby:
# RSI_IFT (smoothed Inverse Fisher Transform RSI)
# Change Log
#
# 2022.01.25 v1.1 @cos251 - Added .01 multiplier per proper forumat; pointed out by @bigboss
#
# 2021.01.29 v1.0 @cos251 - Intial Script; takes smoothed 5 period RSI and puts it # through Inverse arctanh(x) forumla
#
#CREDITS
# - https://www.mesasoftware.com/papers/TheInverseFisherTransform.pdf
# - https://www.mql5.com/en/articles/303
declare lower;
#--- Inputs
input useMultiplier = no;
input length = 5;
def over_Bought = .5;
def over_Sold = -.5;
input paintbars = no;
input showVerticalLines = yes;
input audibleAlerts = yes;
#--- End Inputs
#--- RSI and Smoothed Inverse RSI Calculation
def R =if useMultiplier then (reference RSI(length, close) - 50) * .1 else (reference RSI(length, close) - 50);
def AvgRSI = MovingAverage(AverageType.Exponential,R,9);
def iRSI = (Power(Double.E, 2 * AvgRSI) - 1) / (Power(Double.E, 2 * AvgRSI) + 1);
plot Inverse_RSI = iRSI;
#AddLabel(yes,iRSI);
Inverse_RSI.SetDefaultColor(Color.DARK_GRAY);
Inverse_RSI.AssignValueColor(if Inverse_RSI > .5 then Color.GREEN else if Inverse_RSI < -.5 then Color.RED else Color.Current);
#--- End RSI and Smoothed Calculation
#--- OB/OS
plot ob = over_Bought;
plot os = over_Sold;
ob.SetDefaultColor(Color.DARK_GRAY);
os.SetDefaultColor(Color.DARK_GRAY);
#--- End OB/OS
#--- Add VerticalLine
def sqzAlert = reference TTM_Squeeze().SqueezeAlert; #Hint -Used for candle price color
AddVerticalLine(showVerticalLines and (iRSI > 0) and (iRSI[1] < 0), "Entry BUY", Color.GRAY);
AddVerticalLine(showVerticalLines and (iRSI[1] > 0) and (iRSI < 0), "Entry SELL", Color.YELLOW);
AssignPriceColor(if paintbars and iRSI > 0 and sqzAlert == 1 then Color.GREEN else if paintbars and iRSI < 0 and sqzAlert == 1 then Color.RED else if paintbars and sqzAlert == 0 then Color.GRAY else Color.Current);
Alert(audibleAlerts and (iRSI > 0) and (iRSI[1] < 0), "Buy", Alert.BAR, Sound.Chimes);
Alert(audibleAlerts and (iRSI[1] > 0) and (iRSI < 0), "Sell", Alert.BAR, Sound.Ding);
UPDATE!!!!!!!!!!
Upper Strategy Indicator v1.0
Per request - here is a strategy version of the RSI_IFT. I've included the following
- Selection between
- Long trade
- Short trade
- Price bar color per trade selection
- Green for long or both
- Red for short or both
- Vertical Lines for RSI_IFT Signal for visual effect
Please remember to save as a strategy and not study!
Thx!
Ruby:
# RSI_IFT_Strat (smoothed Inverse Fisher Transform RSI)
# Change Log
# 2021.08.20 v1.0 @cos251 - Intial Script; takes smoothed 5 period RSI and puts it #
# through Inverse arctanh(x) forumla; converted to strategy for
# back testing purposes
#
# Removing the header credits and description is not permitted, any modification needs to be shared.
#
#CREDITS
# - https://www.mesasoftware.com/papers/TheInverseFisherTransform.pdf
# - https://www.mql5.com/en/articles/303
declare upper;
#--- Inputs
input length = 5;
input tradetype = { default "long", "short", "both" };
input paintbars = yes;
input showVerticalLines = yes;
#--- End Inputs
#--- RSI and Smoothed Inverse RSI Calculation
def R = reference RSI(length, close) - 50;
def AvgRSI = MovingAverage(AverageType.Exponential,R,9);
def iRSI = (Power(Double.E, 2 * AvgRSI) - 1) / (Power(Double.E, 2 * AvgRSI) + 1);
def Inverse_RSI = iRSI;
#--- End RSI and Smoothed Calculation
#--- Add VerticalLine
def sqzAlert = reference TTM_Squeeze().SqueezeAlert; #Hint -Used for candle price color
# and sqzAlert == 1
AddVerticalLine(showVerticalLines and (tradetype == tradetype.long or tradetype == tradetype.both) and (iRSI > 0) and (iRSI[1] < 0), "Entry BUY", Color.GRAY);
AddVerticalLine(showVerticalLines and (tradetype == tradetype.short or tradetype == tradetype.both) and (iRSI[1] > 0) and (iRSI < 0), "Entry SELL", Color.YELLOW);
AssignPriceColor(if paintbars and (tradetype == tradetype.long or tradetype == tradetype.both) and iRSI > 0 then Color.GREEN else if paintbars and (tradetype == tradetype.short or tradetype == tradetype.both) and iRSI < 0 then Color.RED else if paintbars then Color.GRAY else Color.Current);
AddOrder(OrderType.BUY_TO_OPEN, iRSI > 0 and iRSI[1] < 0 and (tradetype == tradetype.long or tradetype == tradetype.both), open, tickcolor = GetColor(9), arrowcolor = GetColor(9), name = "LONG");
AddOrder(OrderType.SELL_TO_CLOSE, iRSI < 0 and iRSI[1] > 0 and (tradetype == tradetype.long or tradetype == tradetype.both),open, tickcolor = GetColor(9), arrowcolor = GetColor(9), name = "LONG_EXIT");
AddOrder(OrderType.SELL_TO_OPEN,iRSI < 0 and iRSI[1] > 0 and (tradetype == tradetype.short or tradetype == tradetype.both),open, tickcolor = GetColor(8), arrowcolor = GetColor(8), name = "SHORT" );
AddOrder(OrderType.BUY_TO_CLOSE, iRSI > 0 and iRSI[1] < 0 and (tradetype == tradetype.short or tradetype == tradetype.both),open, tickcolor = GetColor(8), arrowcolor = GetColor(8), name = "SHORT_EXIT");
Last edited: