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:

henry1224

Active member
VIP
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.
 

BenTen

Administrative
Staff member
Staff
VIP
@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));
 

henry1224

Active member
VIP
qBv7dnS.gif


@MerryDay, as you can see , the IFT lags several indicators both long and short by several bars
 

MerryDay

Administrative
Staff member
Staff
VIP
@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:

henry1224

Active member
VIP
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

New member
@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
 

XeoNoX

Well-known member
VIP
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);
 

Namor

New member
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

Top