Back

Hows does Lean mark to market at the end of algorithm?

Hi Team,

It seems that Lean does not mark to market all open positions at the end of algorithm for backtest? Correct me if i'm wrong.
I saw there is a block which liquidate all holding in AlgoritmManager, I believe if that block is called, the portfolio return/value would be MTM.
However it is only available for live mode. Is it by design?
Thank you.

Jianwei
Update Backtest








Hey Jianwei, if I understand you correctly -- the equity chart and therefore daily gain-loss used to calculate the statistics is updated with the latest prices every minute of the backtest. If you have holdings at the end of a backtest they are accounted for by the equity value.

We removed the backtest default liquidation at the end of an algorithm because we didn't want the final sale/transaction fees to kill an algorithms statistics if the algo-writer didn't intentionally intend to sell them.
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.


Thx Jared.
0

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