Back

Adjust total portfolio value

Hi all

Does anyone know if it's possible to change the equity value that is displayed on the bar? I would like to implement the 2/20 fee for my strategy. However I was unable to set the fee model as the fee model is used for specific securities and not for the entire portfolio as a whole. Hence was wondering if i can manually calculate the fee and then deduct it from my total portfolio value, which will be reflected on the bar at the top of the backtesting? 

Thank you and appreciate your help there!

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.


Hi Jenny, I've replied to the same question here

0

Hi Jenny,

To add additional data to the equity value, so we can plot the equity after the 2/20 fees are applied, or to create a separate chart altogether, I suggest trying out our Plotting mechanism (to plot on the Equity chart itself, use self.Plot(‘series name’, value), and for a separate chart, use self.Plot(‘chart name’, ‘series name’, value) ). However, in the code of the attached backtest, the 2/20 fees will be baked into the main Equity curve itself.

I am unsure about how you would like to calculate the 2/20 fees, but two values that I think that may be useful are self.Portfolio.TotalProfit and self.Portfolio.TotalHoldingsValue. To see more values related to the portfolio, see our documentation here. Nonetheless, I will show one way to compute the 2/20 fees in the attached backtest, and I'll also set the trading fees to 0.

Addressing how to do this computation yearly on the other post, we can use Scheduled Events. We can keep track of the number of months have passed, and execute our function every 12 months, or alternatively, check if the current month is December, and this can also be seen in the attached backtest.

Best,
Shile Wen

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.


Hi Shile Wen and Arthur

Thank you for your replies! They worked for me!

However, I have a question for Shile Wen. If I were to deploy my algorithm to live trading, will the Portfolio.SetCash still work? From my understanding, when the algorithm is deployed to live, the setcash will be ignored.

Thank you!

0

Hi Jenny,

You are correct in that SetCash will be ignored in live-trading, and the portfolio value will reflect the value in the brokerage account.

Best,
Shile Wen

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