Back

Costs of shorting stocks

What costs are modelled when backtesting shorting of a security? Can these shorting costs somehow be set by the user?

Being able to see a daily or montly P&L from the backtest would be a great addition to the features of the platform to provide data like the above.

Update Backtest







No, they're not modeled; we made an attempt which didn't hit all the targets so was closed. We have the portfolio value available in Portfolio.TotalPortfolioValue. Daily P&L is just TotalPortfolioValue today - yesterday.

https://github.com/QuantConnect/Lean/issues/32
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.


OK thanks for clarifying.

As an alternative solution could you consider adding a function to the API for the user to debit a custom cost to portfolio cash? This way the user can do custom calculation to apply estimated periodic costs for leverage / shorting / whatever else might be applicable in their situation.

0

self.Portfolio.Cash["USD"] -= 10

I think this should work in backtesting.

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