Back

Better live tracking statistics?

Hi I saw a thread over 2 years ago about implementing backtesting statistics into live trading, is there a plan for this still?

Overall the live testing stats seem very wonky.

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.


I can see you can load custom data:

SetRuntimeStatistic(string name, string value);

How can I load WinRate for example? Kinda hard digging through the Docs.

0

Hi Elsid, 

Did you get anywhere with this? I'd like to have the backtesting statistics in live trading as well. Problem with runtime stats is that when you redeploy it starts over :(

Tim 

0

I have created a new issue in GitHub so that we can keep a track of the developments of this feature:
Runtime statistics access for algorithms #2688

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 guys,

I see the issue is still open on GitHub, but maybe someone found a way around to access rolling statistics?

0

Sorry at the moment this class is calculated based on the final math. You can calculate some of them by using the static Statistics class. You can see the available methods here, and use as demonstrated below.

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.


Thanks Jared!

I was mostly interested by accessing the Statistics class to access the % drawdown over time:

_Drawdown = QuantConnect.Statistics.Statistics.DrawdownPercent(equityOverTime,2);

But I was not sure how to access the equityOverTime.

I found a way around which is not perfect but give a good approximation of the portfolio drawdown overtime, (I am thinking of using that to stop a strategy if it goes below a certain threshold). I am attaching a backtest to share with the community in case it can be helpful.

I would be interested to know how to do it the correct way though. Is there an easy way to access the equityOverTime.?

0


Hi Pi..R,

We can calculate equity over time by adding a member to our algorithm

public SortedDictionary<DateTime,decimal> equityOverTime = new SortedDictionary<DateTime,decimal>();

and appending to it periodically

public override void OnEndOfDay()
{
equityOverTime.Add(Time, Portfolio.TotalPortfolioValue);
}

See the attached backtest for a full example.

Best,
Derek Melchin

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.


Thanks Derek, very helpful!

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