Fisher Transform For ThinkOrSwim

Merry,

If I may indulge you. I tried to make this a strategy but I still haven't been able to code it properly. What am I missing in AddOrder?

def BuyTrigger = = FT > ema2 then 1 else 0;
def SellTrigger = FT < ema2 then 1 else 0;

AddOrder(OrderType.BUY_AUTO, BuyTrigger );
AddOrder(OrderType.Sell_AUTO, SellTrigger );
Did you try FT crosses above/below ema2?
 
Another nice Indicator converted from Tradingview to TOS, Enjoy!
Original Link: https://www.tradingview.com/script/Q0eQz7ll-Fisher-Transform-Indicator-by-Ehlers-Strategy/

Photo
13500[/ATTACH]']
dxSORAA.png


script
Code:
#Fisher20 Converted from TradingView by mbarcala
#Original Link: https://www.tradingview.com/script/Q0eQz7ll-Fisher-Transform-Indicator-by-Ehlers-Strategy/
#////////////////////////////////////////////////////////////
#//  Copyright by HPotter v1.0 01/07/2014
#//     Market prices do not have a Gaussian probability density function
#//     as many traders think. Their probability curve is not bell-shaped.
#//     But trader can create a nearly Gaussian PDF for prices by normalizing
#//     them or creating a normalized indicator such as the relative strength
#//     index and applying the Fisher transform. Such a transformed output 
#//     creates the peak swings as relatively rare events.
#//     Fisher transform formula is: y = 0.5 * ln ((1+x)/(1-x))
#//     The sharp turning points of these peak swings clearly and unambiguously
#//     identify price reversals in a timely manner. 
#////////////////////////////////////////////////////////////
#study(title="Fisher Transform Indicator by Ehlers Strategy", shorttitle="Fisher Transform Indicator by Ehlers")

declare lower;

input length = 20;

def hhigh = Highest(hl2, length);
def llow = Lowest(hl2, length);

def round = if 0 > .99 then .999 else if 0 < -.99 then -.999 else Double.NaN;

def value = round(.66 * ((hl2 - llow) / max(hhigh - llow, .001) - .5) + .67 * value[1]);

plot fish1 = .5 * log((1 + value) / max(1 - value, .001)) + .5 * IsNAN(0);

plot fish2 = fish1[1];

plot line15 = 1.5;
line15.SetDefaultColor(Color.DARK_RED);
line15.SetStyle(Curve.SHORT_DASH);

plot line75 = 0.75;
line75.SetDefaultColor(Color.DARK_GRAY);
line75.SetStyle(Curve.SHORT_DASH);

plot cline = 0;
cline.SetDefaultColor(Color.GRAY);
cline.SetStyle(Curve.SHORT_DASH);
cline.SetLineWeight(2);

plot line75n = -line75;
line75n.SetDefaultColor(Color.DARK_GRAY);
line75n.SetStyle(Curve.SHORT_DASH);

plot line15n = -line15;
line15n.SetDefaultColor(Color.DARK_RED);
line15n.SetStyle(Curve.SHORT_DASH);
 

Attachments

  • dxSORAA.png
    dxSORAA.png
    255.6 KB · Views: 139
Last edited by a moderator:
Another nice Indicator converted from Tradingview to TOS, Enjoy!
Original Link: https://www.tradingview.com/script/Q0eQz7ll-Fisher-Transform-Indicator-by-Ehlers-Strategy/

Photo
13922[/ATTACH]']
dxSORAA.png


script
Code:
#Fisher20 Converted from TradingView by mbarcala
#Original Link: https://www.tradingview.com/script/Q0eQz7ll-Fisher-Transform-Indicator-by-Ehlers-Strategy/
#////////////////////////////////////////////////////////////
#//  Copyright by HPotter v1.0 01/07/2014
#//     Market prices do not have a Gaussian probability density function
#//     as many traders think. Their probability curve is not bell-shaped.
#//     But trader can create a nearly Gaussian PDF for prices by normalizing
#//     them or creating a normalized indicator such as the relative strength
#//     index and applying the Fisher transform. Such a transformed output
#//     creates the peak swings as relatively rare events.
#//     Fisher transform formula is: y = 0.5 * ln ((1+x)/(1-x))
#//     The sharp turning points of these peak swings clearly and unambiguously
#//     identify price reversals in a timely manner.
#////////////////////////////////////////////////////////////
#study(title="Fisher Transform Indicator by Ehlers Strategy", shorttitle="Fisher Transform Indicator by Ehlers")

declare lower;

input length = 20;

def hhigh = Highest(hl2, length);
def llow = Lowest(hl2, length);

def round = if 0 > .99 then .999 else if 0 < -.99 then -.999 else Double.NaN;

def value = round(.66 * ((hl2 - llow) / max(hhigh - llow, .001) - .5) + .67 * value[1]);

plot fish1 = .5 * log((1 + value) / max(1 - value, .001)) + .5 * IsNAN(0);

plot fish2 = fish1[1];

plot line15 = 1.5;
line15.SetDefaultColor(Color.DARK_RED);
line15.SetStyle(Curve.SHORT_DASH);

plot line75 = 0.75;
line75.SetDefaultColor(Color.DARK_GRAY);
line75.SetStyle(Curve.SHORT_DASH);

plot cline = 0;
cline.SetDefaultColor(Color.GRAY);
cline.SetStyle(Curve.SHORT_DASH);
cline.SetLineWeight(2);

plot line75n = -line75;
line75n.SetDefaultColor(Color.DARK_GRAY);
line75n.SetStyle(Curve.SHORT_DASH);

plot line15n = -line15;
line15n.SetDefaultColor(Color.DARK_RED);
line15n.SetStyle(Curve.SHORT_DASH);
Turns out that the market might be more accurately picked by a Discrete function like Poisson.
 

Attachments

  • dxSORAA.png
    dxSORAA.png
    255.6 KB · Views: 116
not a sacanner script its for study script,I was able to code the script for fisher study but I want to do it is instead off length can it do multiple lengths instead for doing each length make a study.

input FisherLen = 5; ### from length 5 to 10
input ObOs = 200;
def maxHigh = Highest(high, FisherLen);
def minLow = Lowest(low, FisherLen);
 
not a sacanner script its for study script,I was able to code the script for fisher study but I want to do it is instead off length can it do multiple lengths instead for doing each length make a study.

input FisherLen = 5; ### from length 5 to 10
input ObOs = 200;
def maxHigh = Highest(high, FisherLen);
def minLow = Lowest(low, FisherLen);
length in TOS should be constant not variable. I am not sure if anyone can help to find the highest high for variable period through fold and getvalue().
 

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

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

87k+ Posts
278 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