Unable to retrieve same backtest results with same code

Back

Hi all,

Yesterday, I was backtested 2020 (see attached) and I am unable to generate the same results today? Even with copying the algorithm?

Can someone replicate the same results or explain as to why I they're different?

Thanks, Marc

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.


Here is me attempting to run it again:

1


Hey there! We introduced spread data into the trades so market orders will fill at the asking price, not just the last trade price. This will have profound impacts if your strategy trades on low volume stocks with wider spreads.

You may be able to reclaim some of this performance by switching to limit orders but it will not be a guaranteed fill. 

See more in the related discussion thread.

1

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.


Hi Jared,

Just wanted to confirm with you my understanding - so the actual order execution is closer to real trading since orders are executing according to Bid/Ask price? In comparison with previous version where all orders where executed at midpoint/average price.

So if I open and immediately close an order during backtesting, I will see loss which is equal to spread, like on real trading - am I right?

PS: Thanks for this work on introducing ask/bid prices!

Thanks, Grigori.

0

>So if I open and immediately close an order during backtesting, I will see loss which is equal to spread, like on real trading - am I right?
Correct. 100%

Thanks to JayJayD and Martin Molinero. It's taken about 6 months but it is in production! There will be a few days of fast patches as the community spots issues in the data but long term this will be an order of magnitude better than before. 

1

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.


Awesome, thanks for the update. I thought I was going crazy.

>In comparison with previous version where all orders where executed at midpoint/average price.

I believe we didn't have bid/ask price so we couldn't get the average, we were filling orders at the most immediate price, right?

Looks like I have to re-evaluate the strategy haha, and I'll direct my questions to the link you provided if I have any.

0

>we were filling orders at the most immediate price, right?
We were filling at the last trade price. If you have an illiquid security say which trades every 20 minutes the jumps from the last trade to the next one can be quite large. With quote data the quotes are updated often before a trade giving a more realistic fill.

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