Hello,
I would like to create a custom window indicator from more than one serie (let's say a X1, X2, X3) and compute a linear regression X1 = b0 + b1*X2 + b2*X3
I found the class Lean/Indicators/LeastSquaresMovingAverage.cs but it's only based on one serie and the time.
The probleme is not the linear regression obiously but creating a aggregator indicator hat takes as input N series.
Is it something possible?
Thank you for your help,
Julien
Alexandre Catarino
Hi Julien,
We have plans to implement multi-asset indicators as a future QuantConnect feature.
However, it is possible to implement a multi-asset linear regression right now using Math.NET (same library used in LeastSquaresMovingAverage).
In the example below, I take one year of SPY, AIG and BAC to compute a linear regression: SPY = p1 * AIG + p2 * BAC, where p1 and p2 are calculated with MathNet.Numerics.LinearRegression:
Vector<double> p = MultipleRegression.NormalEquations(X, y);
where X is a matrix of closing prices of AIG and BAC, while y is a vector of SPY closing prices.
JulienCoppey
Hello Alexandre,
Thank you for you temporary solution.
Do you know how can I be noticed when this feature (multi-asset indicators ) will be released?
This feature can bee very usefull for pair/basket-trading which is a wide class of strategy.
Thank you
Alexandre Catarino
Hi Julien,
When new features are released we make sure that a related QuantConnect University project is created and announced at this community forum.
JulienCoppey
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!