Back

How to plot Benchmark in Strategy Equity to compare charts?

How to plot Benchmark in Strategy Equity to compare the charts?
Moreover, can it be done without code change?
 

Maybe I can do something like
self.Plot('Strategy Equity', 'Benchmark', data.X)
But I can't find how to get Benchmark value or accumulated SPY in data slice. Thanks!  

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.


Hey Shih,

Unfortunately, it's not currently possible to plot on the strategy equity graph. However you can using self.Plot to create a chart with both the benchmark and portfolio values.

Since we want to measure performance rather than absolute value. We need to scale our benchmark to the inital value of our portfolio. Then we can track our benchmark by calculating its daily performance, computing today's value and plotting it.

To plot our strategy equity, we can just plot our total portfolio value.

Here's an example with a buy and hold strategy.

 

3

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,

Now QC interface looks different and that example does not work. It looks different in Lab than in that Discussion Forum.

How to plot benchmark on strategy equity chart?

 

Robert

0

Hey Robert, sorry about the delay. To plot on the Strategy Equity plot you just need to use the chart name:

self.Plot("Strategy Equity", "MyBenchmark", myValue)

 

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.


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