I am getting unexpected results (and not prepared to declare 'bugs') regarding dates and open and close prices that I am hoping someone can help explain. So I created a research notebook below to demonstrate most of my issues by pulling some historical data for EURUSD, and using 2 Indicators, ATR and PSAR with a timeframe to fall over the end of year holiday season.
Dates
What I noticed was that the historical pricing data and the indicators' dates don't "match" or "align" as you would expect. To visually demonstrate this, I joined the dataframes and highlighted where historical data had dates the indicators didn't have, and vice versa. This clearly happens on holidays and weekends, which is good to some extent, because I can just drop them. However, this leaves a lot of questions that give me pause as to their accuracy or more likely to "how I am doing it."
My questions:
- Why don't they both have the same 'dates' of data?
- Why do the indicators HAVE data for historical dates with NO data?
- Why do the indicators have NO data for historical dates WITH data?
- What is qb.SetTimeZone() supposed to affect?
- Why does qb.History() return something called a "remapper" versus the dataframe the qb.Indicator() returns? (reviewing the PandasData.cs from GitHub didn't reveal much, but that probably speaks to my level of coding.)
- Why isn't the open price price exactly the same as the close price from the previous day?
- Is it a new 'tick'? Hence the typically very small difference?
Wade Wright
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!