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. 🙂
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue