Back

Why prices in function passed to GetUniverse differ from history prices for the same moment?

Hi,
I have some questions related to the selector function used in AddUniverse.

1.
I've compared data used in it for asset selection to both History data and current data at the beginnind of the day, and found they are different. For example, my backtest outputs from the Universe creation function

2017-09-07 00:00:00 :---- Prices when adding universe, 9/6/2017 4:00:00 PM ----2017-09-07 00:00:00 :A RPTMYV3VC57P, price: 64.67, volume: 642697 at 9/6/2017 4:00:00 PM

, but later, in sheduled function, i receive

2017-09-07 09:31:00 :---- Prices at 9/7/2017 9:30:00 AM ----2017-09-07 09:31:00 :Portfolio: A RPTMYV3VC57P, price: 64.53703201300 at 9/7/2017 9:30:00 AM

for the day beginning and

2017-09-07 09:35:00 :---- History data at 9/7/2017 9:35:00 AM ----2017-09-07 09:35:00 :History, 5' ago, A RPTMYV3VC57P: 9/6/2017 4:00:00 PM, price: 64.53703201300

via History.
Why is it so? Is it due to differences of resolution? Have I to set resolution explicitely? How to make data I use for selection, equal to data I use for other calculations?

2. Why log timestamps differ from the output time and what do they mean? Have I to specify timezone in code?

3. As I noticed, the function passed to AddUniverse ran at the end of the first day, after all sheduled functions are called, thus i can not obtain universe for the first day of test. Is it right and how do I create universe for the first day?

4. Somewhy the function showCurrentPrices sheduled to the 5th minute of the day, (simultaneously with showCurrentPrices), does not run. Why?

 

Update Backtest








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