Adjustments to the IFT Stochastic

Namor

New member
Hello Ben,

How would you alter this script to mute the Stochastic signal, leaving only the IFT signal with accompanying alarms?

Code:
# TD Ameritrade IP Company, Inc. (c) 2012-2020

#

declare lower;

input price = close;
input length = 30;
input slowingLength = 5;
input over_bought = 60;
input over_sold = 30;

def rainbow = reference RainbowAverage(price = price, averageType = AverageType.WEIGHTED);
plot Stochastic = sum(rainbow - Lowest(rainbow, length), slowingLength) / (sum(Highest(rainbow, length) - Lowest(rainbow, length), slowingLength) + 0.0001) * 100;

def normStochRainbow = 0.1 * (Stochastic - 50);
plot IFT = 100 / (1 + exp(-2 * normStochRainbow));
plot OverBought = over_bought;
plot OverSold = over_sold;

Stochastic.SetDefaultColor(GetColor(1));
IFT.SetDefaultColor(GetColor(2));
OverBought.setDefaultColor(GetColor(5));
OverSold.setDefaultColor(GetColor(5));
 
Last edited by a moderator:
The IFT line is slow! Why would you want to trade it? Would you not want to get into a trade earlier?
The bus has left the station, Are you going to continue to chase it ? Hoping to catch it late and then find that it reverses and now you are trapped.
 

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

@Namor As requested:

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2012-2020
#

declare lower;

input price = close;
input length = 30;
input slowingLength = 5;
input over_bought = 60;
input over_sold = 30;

def rainbow = reference RainbowAverage(price = price, averageType = AverageType.WEIGHTED);
def Stochastic = sum(rainbow - Lowest(rainbow, length), slowingLength) / (sum(Highest(rainbow, length) - Lowest(rainbow, length), slowingLength) + 0.0001) * 100;

def normStochRainbow = 0.1 * (Stochastic - 50);
plot IFT = 100 / (1 + exp(-2 * normStochRainbow));
plot OverBought = over_bought;
plot OverSold = over_sold;

#Stochastic.SetDefaultColor(GetColor(1));
IFT.SetDefaultColor(GetColor(2));
OverBought.setDefaultColor(GetColor(5));
OverSold.setDefaultColor(GetColor(5));
 
qBv7dnS.gif


@MerryDay, as you can see , the IFT lags several indicators both long and short by several bars
 
@henry1224 The IFT along w/ other indicators on the 5min chart is simply the best and most consistent indicator in my toolbox to determine entry. I have not used it on the daily chart but even your example illustrates my point. I wouldn't enter a trade on any of the points you highlighted. The IFT shows the most optimal entry point in your example.

KHVq7fp.png
 
Last edited:
I have added a average to the Stochastic and have added clouds

Here is the code:

Code:
##########

# TD Ameritrade IP Company, Inc. (c) 2012-2020
#

declare lower;

input price = close;
input length = 30;
input slowingLength = 5;
input over_bought = 60;
input over_sold = 30;

def rainbow = reference RainbowAverage(price = price, averageType = AverageType.WEIGHTED);
plot Stochastic = sum(rainbow - Lowest(rainbow, length), slowingLength) / (sum(Highest(rainbow, length) - Lowest(rainbow, length), slowingLength) + 0.0001) * 100;
Plot StochasticA = ExpAverage(Stochastic,SlowingLength);

def normStochRainbow = 0.1 * (Stochastic - 50);
plot IFT = 100 / (1 + exp(-2 * normStochRainbow));
plot OverBought = over_bought;
plot OverSold = over_sold;
AddCloud(IFT,OverBought, Color.Lime, Color.Pink);
AddCloud(OverSold,IFT, Color.Pink, Color.Lime);

Stochastic.SetDefaultColor(GetColor(1));
Stochastic.SetLineWeight(2);
StochasticA.SetDefaultColor(Color.Magenta);
StochasticA.SetLineWeight(2);
IFT.SetDefaultColor(Color.Yellow);
IFT.setLineWeight(2);

OverBought.setDefaultColor(GetColor(5));
OverSold.setDefaultColor(GetColor(5));
 
@Namor As requested:

Code:
#
# TD Ameritrade IP Company, Inc. (c) 2012-2020
#

declare lower;

input price = close;
input length = 30;
input slowingLength = 5;
input over_bought = 60;
input over_sold = 30;

def rainbow = reference RainbowAverage(price = price, averageType = AverageType.WEIGHTED);
def Stochastic = sum(rainbow - Lowest(rainbow, length), slowingLength) / (sum(Highest(rainbow, length) - Lowest(rainbow, length), slowingLength) + 0.0001) * 100;

def normStochRainbow = 0.1 * (Stochastic - 50);
plot IFT = 100 / (1 + exp(-2 * normStochRainbow));
plot OverBought = over_bought;
plot OverSold = over_sold;

#Stochastic.SetDefaultColor(GetColor(1));
IFT.SetDefaultColor(GetColor(2));
OverBought.setDefaultColor(GetColor(5));
OverSold.setDefaultColor(GetColor(5));
Hello Ben...Just wondering is there a way to set the alarms on the modified IFT so that they are constantly active. Currently I have to re-log them in continuously after they are triggered. Thanx
 
Hello Ben...Just wondering is there a way to set the alarms on the modified IFT so that they are constantly active. Currently I have to re-log them in continuously after they are triggered. Thanx

you can try this, note that you MUST have the chart open for this to work, if you switch or close the chart it will not work.

your sound alert options are limited to:
Sound.Bell,
Sound.Chimes,
Sound.Ding,
Sound.NoSound,
Sound.Ring

Code:
Alert(IFT, "MY ALERT TRIGGER",  Alert.BAR, Sound.Chimes);
 
you can try this, note that you MUST have the chart open for this to work, if you switch or close the chart it will not work.

your sound alert options are limited to:
Sound.Bell,
Sound.Chimes,
Sound.Ding,
Sound.NoSound,
Sound.Ring

Code:
Alert(IFT, "MY ALERT TRIGGER",  Alert.BAR, Sound.Chimes);
Thank you
 

Similar threads

Not the exact question you're looking for?

Start a new thread and receive assistance from our community.

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