-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Issue when using next() #1184
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
When implementing a strategy with 200 MA, you need to account for the initial calculation period. For example with a 200-day MA, you need the data of the previous 200 days before you can generate a valid MA value. During the calculation period, the MA will be NaN - so no signal. This means the strategy will only work from 200 days onwards. Quick fixes in your case would be to either:
Hope that makes sense. |
Indeed, mind the warning on Welcome a better position where this note should be placed. |
When trying to run a simple 200 MA strategy, I want make a purchase at the onset of the data. However, the next function iterates only from the onset of the data+200 days.
Is there a way to do this?
Thank you
The text was updated successfully, but these errors were encountered: