Hi Team,
What is the best way to create indicator on combined data?
For example, in pair trading, you want to long/short Microsoft and Apple. And I want to create MACD on the price difference of the two.
Thank you.
Jianwei
QUANTCONNECT COMMUNITY
Hi Team,
What is the best way to create indicator on combined data?
For example, in pair trading, you want to long/short Microsoft and Apple. And I want to create MACD on the price difference of the two.
Thank you.
Jianwei
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.
Michael Handschuh
var msft = Identity("MSFT"); var aapl = Identity("AAPL");We can then take these and form more complex indicators from them, such as a difference:var diff = msft.Minus(aapl);We can then define a MACD on the difference using:var macdDiff = new MovingAverageConvergenceDivergence(12, 26, 9).Of(diff);All of the above indicators will be auto-updating and should be defined in the algorithm's initialize method. Have a peek at the indicator extension methods here.Jianwei Wang
Jianwei Wang
Jianwei Wang
Michael Handschuh
Jianwei Wang
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!