Why is there value on 9 March 2019 when I am using rollingwindows to capture the historical price?
Don't have an account? Join QuantConnect Today
QuantConnect Community Discussions
QUANTCONNECT COMMUNITY
LEAN is the open-source algorithmic trading engine powering QuantConnect. Founded in 2012 LEAN has been built by a global community of 180+ engineers and powers more than 300+ hedge funds today.
Join QuantConnect's Discord server for real-time support, where a vibrant community of traders and developers awaits to help you with any of your QuantConnect needs.
The Open-Quant League is a quarterly competition between universities and investment clubs for the best-performing strategy. The previous quarter's code is open-sourced, and competitors must adapt to survive.
Inquiring about value on 9 Mar 2019 when using rolling windows to track historical price in QuantConnect.
Continue ReadingRefer to our Research Guidelines for high quality research posts.
Create an account on QuantConnect for the latest community delivered to your inbox.
Sign Up Today
|
|
|||||||
|
|
||||||||
|
Rolling windows historical price
Zc Yong | April 2019
Why is there value on 9 March 2019 when I am using rollingwindows to capture the historical price?
QuantConnectâ„¢ 2025. All Rights Reserved
Zc Yong
Hi, anyone can help?
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.
Zc Yong
9 March 2019 is Saturday
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.
Jack Simonson
Hi,
Since the Rolling Window and Indicators are being updated each day with new data, then there will be data for each day the market is open. With daily resolution data, the timestamp is at 00:00 UTC the next day, so this is why there is data for March 9, 2018, even though it was a Saturday -- it's just the timestamp for the data slice containing the Close price of the 8th.
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.
Zc Yong
Thanks Jack. However, the Saturday issue is only applicable to the Saturday on March 9, 2018 but not the other Saturday. Why is there such inconsistency? Not sure if I understand your explaination correctly, maybe you can elaborate more. Thanks.
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.
Link Liang
Hi Zc,
Our timestamp is 00:00 for all daily resolution data. A data entry with timestamp 2019-03-09 00:00:00 in daily resolution indicates that the timeframe for this data entry is from 2019-03-08 00:00:00 to 2019-03-09 00:00:00, which is Friday.
From the log in your backtest, I see there is data on all Saturday Timestamps, for example, at 2019-03-16 00:00:00 and 2019-03-02 00:00:00. Could you please elaborate more on how to reproduce your inconsistency Saturday issue?
You could find more information regarding time here.
Reminder: logging price is against our terms of service. Please avoid that in the future. Thanks for your support!
Hope it helps!
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.
Zc Yong
Thanks Link Liang for your reply. Do you mind to elaborate more about logging price that you mentioned above? Not sure if you are referring to the plotting of the price, sincerely apologise if I have violated any TOS but my main purpose of price plotting is to investigate the data calculation inconsistency against my raw spreadsheet calculation. Will definitely avoid that in the future.
Back to the issue above, I am actually referring to the 'trade plot' graph in the backtesting results as that is the result of the 'rolling windows' calculation from the raw data. There is no value on the graph on other Saturday like 2019-03-30, 2019-03-23, 2019-03-16 but 2019-03-09. Hope that clarifies.
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.
Link Liang
Hi Zc,
After running a backtest, there should be a message in console “Your log was successfully created and can be retrieved from: {url}“. Click on that url and logs from your algorithm should be there. If the timestamps in the log are consistant, then there is no problem with data.
Hope it helps!
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.
Zc Yong
Noted that I should refer to the logs rather than the chart created. Thanks Link Liang
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.
Jared Broad
Hey Dave, we have finished the code changes required to maintain backward compatibility but didn't want to deploy it on the weekend. We've now got the data, code, and new tests in place and will re-deploy Monday-AM.
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.
Dave Mueller
Awesome! I'm going to check it out tonight =)
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.
Jared Broad
Sorry Dave still delayed; please subscribe to notifications and I'll update this thread as soon as its pushed. We found differences in the ticker symbology and are mapping the tickers back to the current QC format so the data should be nearly identical and not require changes to your code.
It'll likely be 1 day of engineering, 2 days of data processing and then 1 day of retesting. ETA Thursday-Friday.
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.
Arthur Asenheimer INVESTOR
Take all the time you need. Stability and reliability is more important than a quick implementation.
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.
Grigori Gustin
Hi Jared/QC team,
I have noticed that there is access to ask/bid prices in research notebooks for second resolution.
However, I could not access to tick data - is there any work still in progress or the problem is in my code?
Also, is ask/bid data is already available during backtesting?
Thanks, Grigori.
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.
Jared Broad
Hey Grigori! Yes, it was deployed quietly yesterday.
Tick data is also available but it is not the same format as QuoteBars, each Tick has a TickType attached to it. The value of TickType.Quote marks ticks which are bids/asks. These are presented as a list for a specific moment of time.
Our tick data for Equities is now also timestamped to the millisecond! Previously it was rounded down to the previous second
--.
Live Trading does not have the new quote feed yet -- we're working on that and it'll be installed in the next week or two. We're literally waiting on physical delivery of some 10GB fiber modules and with the virus, everything is moving slowly.
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.
Grigori Gustin
> Tick data is also available but it is not the same format as QuoteBars, each Tick has a TickType attached to it.
Trying to access Resolution.Tick through qb.History() call gives me the following exception:
"Exception : cannot handle a non-unique multi-index!"
Still did not figure out the root cause, the date range seems valid (couple of hours) and it worked before.
Could you please help me on this?
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.
Jared Broad
No problem Grigori but please create a new thread with a sample attached of what you're trying to do or send in a ticket for private support.
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.
Hugh Todd
I've been testing the quoteBars in slice with some low volume ETFs I follow and the availability of bid/ask improves the information content gathered from these price series. Thanks for the continuing improvements to the site. When do you see this data being available for live trading? Thanks, Hugh
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.
Jared Broad
Thanks Hugh;
All going well - we'll do the installation of the new live feed this weekend. We've wired up a brand new rack and are just waiting on a cross-connect cable install for the new data feed. Old live algorithms will need to be stopped and redeployed to move to the new infrastructure.
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.
Laurent Crouzet
Jared Broad I really think it will be an important and a very useful development for QC and the QC's community that all algorithms (those that are working and the new ones) use the new bid/ask structure!
If I understand well, that would also imply that all currently validated Alphas (those on the marketplace) will be stopped and redeployed, right?
Does it also mean that it would deplete the portfolio (cancellation of all insights) of these Alphas? Or as long as everything goes smoothly during the week-end (as no market is open), the Alphas will still keep their current investments?
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.
Hugh Todd
Thanks Jared. We appreciate the efforts you all are putting into this.
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.
Jared Broad
Pleasure Hugh!
Laurent: All QuantConnect backtest algorithms currently use spread, and soon live trading will as well. Once the new live feed is installed Alphas will need to be stopped and redeployed. An Alpha should reinitialize its state in the event of a shutdown, so it should resume their previous positions. When we eventually restart them we'll do it after market close; before universe selection; on Friday. This should minimize the impact of most of the alphas. We'll mark on the charts when the alpha was redeployed with the spread data.
A nice side effect as well -- our new live history server should be 10x faster =) Not quite sure how much faster yet as it's a new approach which should make things close to backtesting speeds.
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.
Laurent Crouzet
Ok, thank you Jared. Hopefully, everything will be as smooth as possible!
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.
Davide Carbone
Hi Jared,
do you have an estimated release date for the L1 Equity Quote in live mode?
Thanks
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.
Cary Cocke
Words cannot express my thanx and praises enough!
OUTSTANDING WORK......this is why I love QC
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.
Arthur Asenheimer INVESTOR
Now that L1 Equity Quotes are available for backtesting, the next step would be a good market impact model (slippage model).
For example, when a Buy Market Order is submitted, I have to take into account not only the spread, but also the available volume at the next best bid price offer.
So if you want to buy 1,000 shares of XYZ and the current bid price is $ 100.00, but only 100 shares are offered at that price, the order will not be executed in full at $ 100.00, but will reach the next level in the order book and execute the next orders at $ 100.01 and so on.
As a result, the average execution price wil be higher than current backtesting suggests.
If you want to display it 100% realistically, you would need the complete history with the highest granularity (Tick) of the entire order book (Full DOM = Full Depth of Market, i.e. Level 2 Data). You can imagine that this would pose completely new challenges to the hardware performance as the data volumes would be enormous. Therefore it makes sense to work with models that are very close to reality.
Quantopian offers various slippage models for this. I personally prefer to talk about market impact models as this is also common practice in the scientific literature.
As you can see in the documentation here, the Alpha Streams Brokerage Model uses a constant Slippage model.
So my question is: Since we now have L1 Equity Quote Data, I wonder if it wouldn't be possible to create better/more realistic Slippage Models based on that data?
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.
Arthur Asenheimer INVESTOR
Edit: Edit: A good approach would be the square-root formula for market impact, which we can use now where L1 Quote Data and thus the Spreads are available.
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.
Derek Melchin
Hi Arthur,
Interesting suggestion. Users will find our documentation on creating custom slippage models useful when implementing this.
To go forward with this, I recommend starting a new forum thread where alternative slippage models can be discussed. Such a discussion is out of the scope of this thread.
Best,
Derek Melchin
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.
Hugh Todd
Is this available for live trading yet? I'm seeing errors when I try to reference quote bars during live trading with QC data and don't know if it is my model or the state of development.
Thanks, Hugh
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!