Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Dividing Arrays / Stochastic Momentum Index

Hi,
I'm new to Python and algorithmic trading. I tried coding the Stochastic Momentum Index, SMI, which is bounded between -100 and 100 percent, and yet the code does not do this! it exceeds 100 and -100!

Any ideas why?
Thanks!

3 responses

fixed it with this.

It looks like at least your buy condition is never satisfied. Do you need to tweak some parameters?

oh yeah, change the 40 and -40 to 0.4 and -0.4 so i work in decimals rather than percent :p