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.
QUANTCONNECT COMMUNITY
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.
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.
Jack Pizza
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.
Timothy Comisky
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
Alexandre Catarino
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
Pi..R
Hi guys,
I see the issue is still open on GitHub, but maybe someone found a way around to access rolling statistics?
Jared Broad
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.
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.
Pi..R
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.?
Derek Melchin
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
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.
Pi..R
Thanks Derek, very helpful!
Jack Pizza
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.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!