I tried the same DayTradeTest algorithm both in the cloud and on my local machine. It was run on minute resolution. The algorithm bought 1 share of AAPL on 9:40am, June 5, 2014 and submitted a MarketOnCloseOrder. But:
In the cloud:
The MarketOnCloseOrder() was filled at the price of $647.35, which is the close price of the 15:59-16:00 minute bar. (I use Debug() in OnData() to verify the close price of that bar)
In my local machine:
I tried the same algorithm in my local environment The MarketOnCloseOrder() was also filled at $647.35. But according to the downloaded data, it was the close price of the 15:58-15:59 bar.
I don't mind the difference of the prices between the cloud data and local data. But I do concern that in the local backtest, the MarketOnCloseOrder was NOT filled at the price of the 5:59-16:00 bar.
謝永德
I just realized that I made a mistake about the post. The problem actually is:
In the downloaded sample AAPL minute data, on June 5, 2014:
15:58-15:59, Close=647.35
15:59-16:00, Close=646.93
During the backtest, the LEAN engine, in the OData() function, when the end time of the bar became 16:00, the close price was 647.35, instead of 646.93.
謝永德
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!