Registered User Joined: 3/21/2005 Posts: 9
|
I want to make my Stochastics indicator look the same as that in ThinkorSwim. Support recommended I review this article.
http://www.tc2000.com/tc2000help/#Indicators/Stochastics.htm#kanchor83
I did, but I'm still having issues.
This is the code I'm using in TOS. (Note: you can ignore the extra lines being drawn at the bottom, as I already know who to draw them in TC2K).
#
# TD Ameritrade IP Company, Inc. (c) 2008-2014
# STODTP, Modified from StochasticFull, to add horizontal lines at 38, 50, 62
#
declare lower;
input over_bought = 80;
input over_sold = 20;
input KPeriod = 6;
input DPeriod = 5;
input priceH = high;
input priceL = low;
input priceC = close;
input slowing_period = 3;
input averageType = AverageType.SIMPLE;
def lowest_k = Lowest(priceL, KPeriod);
def c1 = priceC - lowest_k;
def c2 = Highest(priceH, KPeriod) - lowest_k;
def FastK = if c2 != 0 then c1 / c2 * 100 else 0;
plot FullK = MovingAverage(averageType, FastK, slowing_period);
plot FullD = MovingAverage(averageType, FullK, DPeriod);
plot OverBought = over_bought;
plot OverSold = over_sold;
FullK.SetDefaultColor(GetColor(6));
FullD.SetDefaultColor(GetColor(5));
OverBought.SetDefaultColor(GetColor(6));
OverSold.SetDefaultColor(GetColor(6));
plot line38 = 38;
line38.setDefaultColor(getColor(5));
plot line62 = 62;
line62.setDefaultColor(getColor(5));
plot line50 = 50;
line50.setDefaultColor(getColor(08));
In TC2K, I've set %K = 6; %D = 5; Period = 3; Average Type = Simple.
TC2K is close, but still not an exact match for TSO. What other changes should I make? Thanks for your help!
|
 Administration
Joined: 9/30/2004 Posts: 9,187
|
Set the period to 6, %K to 3, and %D to 5 and see if that matches. That is a "slow" stochastic.
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
If I am understanding the code correctly (which is not guaranteed), you want the Period set to 6, the %K set to 3 and the Average Type set to Simple in the Stochastics indicator itself. And you would want Period set to 5 and Average Type set to Simple in the %D indicator.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
Registered User Joined: 3/21/2005 Posts: 9
|
Thank you, Gentlemen. That looks like it's a match for TOS. Genius!
|

 Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You're welcome.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|