Back

Custom Benchmarks for Backtesting

Hello all.
Just wondering if anyone has figured out how to change the benchmark to user discretionary symbols for backtesting.
Cheers!
~C

Update Backtest








Welcome Cary! You can set custom benchmarks with the SetBenchmark API -- it accepts either a string ticker, or a function which can return any values you like.

Using the function you could make your benchmark be a straight line.

You can see the example algorithm on github.

2

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.


Thank you, Jared!!

0

Jared,
I got the benchmark to work, however, the chart has lost the candlesticks. I am trying to use GDX and NUGT as benchmarks. The algo buys every day, regardless of anything, so it isn't that the algo isn't buying. I can see the equity value increase but the plot shows a straight line.
I used SetBenchmark ("GDX");

0

It seems to be working fine @Cary -- if you'd like better help please attach a backtest/code to help us diagnose.

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