Stochastic Momentum Index Code Help

I just want the below settings into Stochastic Momentum Index Code. I use this on a 15 minute chart. Please help me to get the code of it. I am interested in only getting crossovers

%K Periods 50
%K Smoothing Periods 3
%K Double Smoothing Periods 3
%D Period 50
%D Moving Average exponential

Overbought 40
Oversold -40

Run a Google search " stochastics" and look in the AFL Function Reference links which pop up, particularly stochD() and stochK(). That should guide you to a solution.

Also, search for "cross" and study the AFL cross() function. There is your crossover signal generator.

@ghanson it is nice of you to point @dhiraj in the direction of some answers. But @dhiraj appears to be making no effort either to supply the formula, to explain the indicator or to code this himself. He wants everyone else to do his work for him.

Also, the Stochastic Momentum Index is not the same as the "Stochastic". It is a derivation written about by William Blau and I believe first discussed in January issue of Technical Analysis of Stocks and Commodities in 1993.


Thanks for your kind words and pointing out that Stoch Momentum is not regular Stoch. The thought did cross my mind but I figured I would push him to do some of his own work and referred him to the AFL reference.
Indeed, this is not the site for handouts.

1 Like

Agree with that! We seem to have a lot of "AFL Panhandlers" here lately looking for code handouts.

1 Like

This indicator is also discussed in detail in his 1995 book "Momentum, Direction and Divergence", ( ISBN-13: 978-0471027294 )

This is one of the many TA books that is available also in an Italian translation ("Prezzi, momentum e divergenze", William Blau, ISBN-13: 978-888-8253060 ) and directly from the publisher it costs approx. 1/4th compared to the English version.... a fun way to learn Italian!