Getting daily Stochastics value in intraday strategy
Author: akar
Creation Date: 9/15/2020 5:17 AM
profile picture

akar

#1
I'm trying to get the yesterday's stochastics value in an intraday strategy but it doesn't seem to work.

Here's what I'm doing:

CODE:
Please log in to see this code.


However it doesn't seem to work. What's the best way to accomplish this ?
profile picture

Eugene

#2
1. You should synchronize the Daily DataSeries.

2. Put the block outside of the loop. That would be the correct placement which would not lead to executing the time consuming operation hundreds and thousands times instead of just once.

Then refer to the Daily value in the loop.

Please refer to the WealthScript Programming Guide for examples:

* Multi-Time Frame Analysis > Intraday/Daily
* DataSeries > Accessing Secondary Symbols > Secondary Series Synchronization

profile picture

Eugene

#3
Actually it's a bit more complex. This KB article contains a pattern for what you're after: Intraday / Multi-Time Frame | GetIntradayBar and the similar functions. So here's working example:

CODE:
Please log in to see this code.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).