You Are At The Stochastic Cross Page
No There Is No Charge - If You Learn Or Get Something From It  - Contribute What You Think It Is Worth - Trading Is A Craft - I Should Learn It Well

"If, by chance, something less or more proper or necessary I omitted, your indulgence for me is entreated, as there is no one who is without fault, and in all things altogether circumspect." - Fibonacci
Contribute Here - Thank You
Return To Indicators - TOS Scripts - Page

Stochastic Cross
Stochastic Cross, as the name implies it is the K Period crossing the D Period.
Unlike the one offered in think or swim, which only indicates the crossing of overbought or oversold, not a cross of K crossing D.
With this script you choose all your settings, Moving Average Type, K Period, D Period and slowing period.
Boolean only, points or arrows.

Use it with arrow at close if you choose.



Stochastic Cross, up arrow@low & down arrow@high.
The candles are 1 hour.


Script For Think Or Swim - Copy & Paste

input over_bought = 80;
input over_sold = 20;
input KPeriod = 10;
input DPeriod = 10;
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;

def FullK = MovingAverage(averageType, FastK, slowing_period);
def FullD = MovingAverage(averageType, FullK, DPeriod);

# ARROWS
plot KCrossDUp = if FullK crosses above FullD then FullD else Double.NaN;
KCrossDUp.SetLineWeight(5);
KCrossDUp.SetDefaultColor(Color.GREEN);
KCrossDUp.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_UP);
KCrossDUp.HideBubble();

plot KCrossDDown =  if FullK crosses below FullD then FullD else Double.NaN;
KCrossDDown.SetLineWeight(5);
KCrossdDown.SetDefaultColor(Color.RED);
KCrossDDown.SetPaintingStrategy(PaintingStrategy.BOOLEAN_ARROW_DOWN);
KCrossdDown.HideBubble();



Investing And Trading Involve Significant Financial Risk And Is Not Suitable For Everyone. All Information Is Intended For Educational Purposes Only.
To the fullest extent of the law, we will not be liable to any person or entity for the quality, accuracy, completeness, reliability, or timeliness of the information provided on this website,
 or for any direct, indirect, consequential, incidental, special or punitive  damages that may arise out of the use of information we provide to any person or entity
 (including, but not limited to, lost profits, loss of opportunities, trading losses, and damages that may result from any inaccuracy or incompleteness of this information).
We encourage you to invest carefully and read investment information available at the websites of the SEC at http://www.sec.gov and FINRA at http://www.finra.org.

IF YOU DO NOT AGREE WITH THE TERMS OF THIS DISCLAIMER, PLEASE EXIT THIS SITE IMMEDIATELY.  PLEASE BE ADVISED THAT YOUR CONTINUED USE OF THIS SITE
 OR THE INFORMATION PROVIDED HEREIN SHALL INDICATE YOUR CONSENT AND AGREEMENT TO THESE TERMS.


Honor - Respect - Freedom - Country