RSI IFT (Inverse Fisher Transform) For ThinkOrSwim

first of all, thank you @cos251 for posting this indicator, it appears to be the missing piece to the indicator set I've been using, see below:
  • Hurwitz VWAP - google Hurwitz, he posts his TOS vwap tool for free on his site as well some high level vwap instruction
  • MACD BB - not sure where I got this, may have been here or from another TOS indicator group I used to belong to but its the standard macd bb indicator, mine has the white and red dots and zero line goes from green to red depending on where the dots are situated
  • RSI IFT - from this post
  • also I deleted all the EMAs I was using

I primarily "scalp" SPY options and there appears to be a high probability of success when -
  1. the RSI IFT fires buy or sell and at the same time the macd bb dots are crossing above or below the zero line
  2. price is above vwap for calls and below for puts.
  3. If SPY is crossing vwap in the direction of the signal at the same time, these trades appear to be gold.

I'm currently using 200 ticks for SPY and 20 ticks for options, same indicator set for both and only trading morning session. Signals for SPY and option tend to fire simultaneously or within a few bars of each other.

I'm going to keep watching for another day or two, but if what I've seen holds, this should be a profitable strategy and the approach should translate to other instruments and timeframes. Check it out and let me know what you think.

CC @MerryDay , @Superfast
 

Join useThinkScript to post your question to a community of 21,000+ developers and traders.

first of all, thank you @cos251 for posting this indicator, it appears to be the missing piece to the indicator set I've been using, see below:
  • Hurwitz VWAP - google Hurwitz, he posts his TOS vwap tool for free on his site as well some high level vwap instruction
  • MACD BB - not sure where I got this, may have been here or from another TOS indicator group I used to belong to but its the standard macd bb indicator, mine has the white and red dots and zero line goes from green to red depending on where the dots are situated
  • RSI IFT - from this post
  • also I deleted all the EMAs I was using

I primarily "scalp" SPY options and there appears to be a high probability of success when -
  1. the RSI IFT fires buy or sell and at the same time the macd bb dots are crossing above or below the zero line
  2. price is above vwap for calls and below for puts.
  3. If SPY is crossing vwap in the direction of the signal at the same time, these trades appear to be gold.

I'm currently using 200 ticks for SPY and 20 ticks for options, same indicator set for both and only trading morning session. Signals for SPY and option tend to fire simultaneously or within a few bars of each other.

I'm going to keep watching for another day or two, but if what I've seen holds, this should be a profitable strategy and the approach should translate to other instruments and timeframes. Check it out and let me know what you think.

CC @MerryDay , @Superfast
This is a very nice setup @agorena123 - let us know how you fare with it!
 
first of all, thank you @cos251 for posting this indicator, it appears to be the missing piece to the indicator set I've been using, see below:
  • Hurwitz VWAP - google Hurwitz, he posts his TOS vwap tool for free on his site as well some high level vwap instruction
  • MACD BB - not sure where I got this, may have been here or from another TOS indicator group I used to belong to but its the standard macd bb indicator, mine has the white and red dots and zero line goes from green to red depending on where the dots are situated
  • RSI IFT - from this post
  • also I deleted all the EMAs I was using

I primarily "scalp" SPY options and there appears to be a high probability of success when -
  1. the RSI IFT fires buy or sell and at the same time the macd bb dots are crossing above or below the zero line
  2. price is above vwap for calls and below for puts.
  3. If SPY is crossing vwap in the direction of the signal at the same time, these trades appear to be gold.

I'm currently using 200 ticks for SPY and 20 ticks for options, same indicator set for both and only trading morning session. Signals for SPY and option tend to fire simultaneously or within a few bars of each other.

I'm going to keep watching for another day or two, but if what I've seen holds, this should be a profitable strategy and the approach should translate to other instruments and timeframes. Check it out and let me know what you think.

CC @MerryDay , @Superfast
Hi, can you please post your setup via TOS? thank you for your hep!
 
hi @MerryDay, thanks for pointing out the vwap registration notice.

@Options Manor, my screen is split in two with SPY on top chart and option on the bottom. In addition to the chart set up, I have a simple SPY option scan for 0 - 6DTE and over 1k in volume. The scan is set up as a watchlist and I sort by volume. That makes it easy to toggle between options on the chart. Quick note, I used 200 ticks on SPY when I was first setting this up in late August but I believe volume has picked up so may be switching to 400 ticks on SPY, leaving 20 ticks for the options.

Watch it for a few days and you'll see patterns & set ups repeat themselves day after day. Option vwap crosses with the indicators confirming direction tend to be high probability plays.
 
hi @MerryDay, thanks for pointing out the vwap registration notice.

@Options Manor, my screen is split in two with SPY on top chart and option on the bottom. In addition to the chart set up, I have a simple SPY option scan for 0 - 6DTE and over 1k in volume. The scan is set up as a watchlist and I sort by volume. That makes it easy to toggle between options on the chart. Quick note, I used 200 ticks on SPY when I was first setting this up in late August but I believe volume has picked up so may be switching to 400 ticks on SPY, leaving 20 ticks for the options.

Watch it for a few days and you'll see patterns & set ups repeat themselves day after day. Option vwap crosses with the indicators confirming direction tend to be high probability plays.
Interesting setup! Would you be able to share your screen setup? Thanks!
 
@rfb see post 26 regarding sharing screen share via TOS
@MerryDay posting screenshot without code if that's ok, please delete if not allowed

jnEw2V5.png
 
hi @MerryDay, thanks for pointing out the vwap registration notice.

@Options Manor, my screen is split in two with SPY on top chart and option on the bottom. In addition to the chart set up, I have a simple SPY option scan for 0 - 6DTE and over 1k in volume. The scan is set up as a watchlist and I sort by volume. That makes it easy to toggle between options on the chart. Quick note, I used 200 ticks on SPY when I was first setting this up in late August but I believe volume has picked up so may be switching to 400 ticks on SPY, leaving 20 ticks for the options.

Watch it for a few days and you'll see patterns & set ups repeat themselves day after day. Option vwap crosses with the indicators confirming direction tend to be high probability plays.
Have to say, very impressed with your setup. Very well thought out and simple!
 
@rfb see post 26 regarding sharing screen share via TOS
@MerryDay posting screenshot without code if that's ok, please delete if not allowed

jnEw2V5.png
Thanks! Got all the info from the post and VWAP script. All good. Only downside to the VWAP script, it will not work on SPX, at least from my end! Thanks again!
 
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.

KMnErKV.png


Quick Notes
  1. Calculation is based on 5 period RSI then an average
  2. Candle color option is included and takes into account if instrument is in a squeeze or not
    1. On/off setting
Reference Material
https://www.mesasoftware.com/papers/TheInverseFisherTransform.pdf
https://www.mql5.com/en/articles/303


Code:
# RSI_IFT (smoothed Inverse Fisher Transform RSI)
# Change Log
# 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 length = 5;
def over_Bought = .5;
def over_Sold = -.5;
input paintbars = no;
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);
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);



UPDATE!!!!!!!!!!
Upper Strategy Indicator v1.0

Per request - here is a strategy version of the RSI_IFT. I've included the following
  1. Selection between
    1. Long trade
    2. Short trade
  2. Price bar color per trade selection
    1. Green for long or both
    2. Red for short or both
  3. Vertical Lines for RSI_IFT Signal for visual effect

Please remember to save as a strategy and not study!

Thx!

O7Tc812.jpg


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");
not showing anything on the 2nd indicator
 
Had this from long ago. Just a different presentation. Cross zero or color change for signals. Red/green OS/OB
Code:
declare lower;

def e = 2.318281828;
input length = 10;
def overbought = 0.7;
def oversold = -0.7;

def diff = if close > close[1] then close - close[1] else 0;
def diff2 = if close < close[1] then close[1] - close else 0;

rec avg = compoundValue(1, 2 / (length + 1) * diff + (length - 1) / (length + 1) * avg[1], diff * 2 / (length + 1));
rec avg2 = compoundValue(1, 2 / (length + 1) * diff2 + (length - 1) / (length + 1) * avg2[1], diff2 * 2 / (length + 1));

def value = if avg2 != 0 then 100 - 100 / (1 + avg / avg2) else 0;
def Value1 = 0.1 * (value - 50);
def Value2 = wma(Value1, 9);
def IFish = (Power(e, (2 * Value2)) - 1) / (Power(e, (2 * Value2)) + 1 );

plot plot2 = 0.7;
plot plot3 = -0.7;
plot zero = 0;

Plot plot1 = IFish;
plot1.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
plot1.SetLineWeight(2);
#plot1.DefineColor("Up", Color.UPTICK);
#plot1.DefineColor("Down", Color.DOWNTICK);
#plot1.AssignValueColor(if plot1 > plot1[1] then plot1.color("Up") else if plot1 < plot1[1] then #plot1.color("Down") else GetColor(1));

plot1.DefineColor("OverBought", Color.dark_green);
plot1.DefineColor("Normalpos", Color.dark_orange);
plot1.DefineColor("Normalneg", Color.dark_orange);
plot1.DefineColor("OverSold", Color.dark_red);
plot1.AssignValueColor(if plot1 > overBought then plot1.color("OverBought") else if plot1 < overSold then plot1.color("OverSold") else if plot1 < 0.5 then plot1.color("Normalneg") else plot1.color("Normalpos"));
Hi @horserider - I noticed that your RSI calculation used in this script produces different results than the built in tos RSI reference function. I found it interesting that this calculation of RSI matches tradingview's RSI exactly. It's always driven me a little nuts that tradingview and tos calculate RSI differently. Do you have any information you can share on this specific calculation of the RSI?

@cos251 - I was reading through the mesa pdf you link in this indicator's header and noticed that the author recommends both subtracting 50 from, and multiplying by 0.1 the RSI to compress the range of RSI between 5 and -5. They mention this is a range ideally suited to the IFT. Horserider's script does this, as do some other implementations I've seen. I'm curious if that was an oversight in this indicator or a conscious decision you made. I've compared both ways and actually prefer the larger input range because it acts much more like an up/down toggle, similar to RSI Laguerre.

Appreciate any insight either of you have! This is a great indicator.
 
Hi @horserider - I noticed that your RSI calculation used in this script produces different results than the built in tos RSI reference function. I found it interesting that this calculation of RSI matches tradingview's RSI exactly. It's always driven me a little nuts that tradingview and tos calculate RSI differently. Do you have any information you can share on this specific calculation of the RSI?

@cos251 - I was reading through the mesa pdf you link in this indicator's header and noticed that the author recommends both subtracting 50 from, and multiplying by 0.1 the RSI to compress the range of RSI between 5 and -5. They mention this is a range ideally suited to the IFT. Horserider's script does this, as do some other implementations I've seen. I'm curious if that was an oversight in this indicator or a conscious decision you made. I've compared both ways and actually prefer the larger input range because it acts much more like an up/down toggle, similar to RSI Laguerre.

Appreciate any insight either of you have! This is a great indicator.
Thanks for pointing this out. This was an oversight on my part. I've updated the code with an input to allow the user to select to use the .01 multiplier or not. Using the .01 multiplier does show the signal increasing gradually a little earlier but the signals themselves appear to be identical.

Please inspect and let me know if you find anything else.
 
came across this last week somehow, and so far I am really liking the 1min/length combo in my set ups. has anyone found settings that work well on 5, 15min, or longer intraday TF?

it has worked well for me intraday, on 1min and 5min, and obviously not on it's own. i have also modified the signal slightly on my end to look at slope changes. but slowing it down (increasing length) as previous user suggested on the lower TF seems to give good signals. curious what other TF/length combos have worked well for others.
 
Last edited by a moderator:
came across this last week somehow, and so far I am really liking the 1min/length combo in my set ups. has anyone found settings that work well on 5, 15min, or longer intraday TF?
Sorry, you haven't gotten any responses.
Can only recommend you put it on your chart. Nothing beats personal experience ;) The only way you will know what works best for you is to play with the settings and see how the indicator line up w/ your strategy and with your other indicators. To determine if this indicator brings value, analyze it over different timeframes, across history and with multiple instruments.
 
Last edited:
is there a scan for buy signals? tried inputting the "oversold" plot in the scanner condition wizard but got too many results so im not sure if im choosing the oversold plot is he correct method for finding the buy signal.
 
is there a scan for buy signals? tried inputting the "oversold" plot in the scanner condition wizard but got too many results so im not sure if im choosing the oversold plot is he correct method for finding the buy signal.
1. To scan for buy signals, add this to the bottom of your script:
Ruby:
plot scan = (iRSI > 0) and (iRSI[1] < 0) ;[/INDENT]
[INDENT]scan.hide();
2. Save the study
3. Reference the study in the Scan Hacker

How to use this script in the scan hacker:
https://usethinkscript.com/threads/how-to-use-thinkorswim-stock-hacker-scans.284/

No indicator should be used in isolation, especially oscillators.
Try adding another filter to narrow down the results.

read more:
https://usethinkscript.com/threads/rsi-ift-inverse-fisher-transform-for-thinkorswim.6817/#post-73808
https://usethinkscript.com/threads/...nsform-for-thinkorswim.6817/page-2#post-75901
https://usethinkscript.com/threads/...nt-to-successful-trading-in-thinkorswim.6114/
 
Last edited:

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
270 Online
Create Post

Similar threads

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Back
Top