Back

Questions about dates, Open and Close in research notebooks when using historical data with indicators

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:

  1. Why don't they both have the same 'dates' of data? 
  2. Why do the indicators HAVE data for historical dates with NO data? 
  3. Why do the indicators have NO data for historical dates WITH data? 
  4. What is qb.SetTimeZone() supposed to affect?
  5. 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.) 
Open/Close
  1. Why isn't the open price price exactly the same as the close price from the previous day? 
  2. Is it a new 'tick'? Hence the typically very small difference?
Lastly, I am very new to Python (couple of months) so be gentle if it is a total newb mistake #StillLearning  
Update Backtest







0

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.


Update Backtest





0

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.


Loading...

This discussion is closed