You should code your stochastic comparing statement like this instead:
1
2
3
sto=Stochastic[3,5](Close)
condition=sto[2]<sto
The “sto” variable array will be built on the fly by the platform, so you just have to refer to this array of data with number under bracket considering the last n value.
Thanks for the suggestion, it works much better. Although I still get slightly different results compared to the”original”, but I’ll keep working on it. 🙂
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.Ok