You Are At The Stochastic Impulse 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 Impulse
The original Impulse study in think or swim was scripted as a MACD.
With Stochastic impulse it is scripted to function as a Stochastic Impulse that sits on your candles.
It is Boolean, either use points at close, or if you desire you can have a arrow on every candle.
It also will paint your candles, bare in mind the original MACD script had a neutral mode, which never made much sense, this script has no neutral mode.
As a Stochastic has a normal mode, which doesn't make much sense, you should have your Stochastic scripted with curve points, so the slope changes color, up or down.
To set the colors of candles when using paint bars. use the Globals tab and set the colors, ignore the Neutral setting, there is no Neutral.

Use it with point at close if you choose.



Stochastic Impulse with points at close.
The candles are 10 day, 20 point range bars. Caution, in think or swim range bar data can be slow during fast trading activity.



Use it with arrows if you choose.



Stochastic Impulse up arrow@low & down arrow@high.
The candles are 10 day, 20 point range bars. Caution, in think or swim range bar data can be slow during fast trading activity.



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);

def OverBought = over_bought;
def OverSold = over_sold;

input paintBars = yes;

def GreenPrice = FullK > FullK[1] and FullK > FullK[1];
def RedPrice = FullK < FullK[1] and FullK < FullK[1];

plot Bullish = GreenPrice;
def Neutral = !GreenPrice and !RedPrice;
plot Bearish = RedPrice;

Bullish.SetDefaultColor(Color.UPTICK);
Bullish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bullish.SetLineWeight(3);
Bullish.hide();
Bearish.SetDefaultColor(Color.DOWNTICK);
Bearish.SetPaintingStrategy(PaintingStrategy.BOOLEAN_POINTS);
Bearish.SetLineWeight(3);
Bearish.hide();

DefineGlobalColor("Bullish", Color.UPTICK);
DefineGlobalColor("Neutral", Color.Blue);
DefineGlobalColor("Bearish", Color.DOWNTICK);
AssignPriceColor(if !paintBars then Color.CURRENT else if GreenPrice then globalColor("Bullish") else if RedPrice then globalColor("Bearish") else globalColor("Neutral"));



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