Back

Using Math.Net in a backtest

I saw on the forum that we can use Math.Net on QuantConnect.

We just need to add "using Numerics" in the code to do that ?
Update Backtest








Correct:
using MathNet.Numerics.Statistics;

You can see the API for the Numerics library here:
http://numerics.mathdotnet.com/api/MathNet.Numerics.Statistics/Statistics.htm

You would need to build the IEnumerable arrays from tick data. To make your algorithm backtesting fast these arrays should be as short as possible
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.


PS: TradeBars are fine too. I just mean building the arrays from the stream, probably using a queue to enqueue new data, and dequeue old ones
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 would like to do matrix calculation. We can also use MathNet.Numerics.LinearAlgebra ?
0

Hey Jean - yes absolutely it is already in the Numerics library, the entire collection is in that one library. http://numerics.mathdotnet.com/docs/LinearEquations.html

You can access it with:
using MathNet.Numerics.LinearAlgebra

See the help files here with the other classes in library:
http://numerics.mathdotnet.com/api/MathNet.Numerics/index.htm
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