Dear community,
I am trying to implement multiple Alpha models within the Algorithm Framework. The idea is, that trades should only occur when all the Alphas emit unanimous signals. I.e., when at one point in time there is Alpha1 signalling an Up insight and Alpha 2 a Down insight, there should not be any trade. Trading only if both are Up or Down.
I was trying to accomplish that by iterating through the activeInsights.Direction within the PorfolioConstruction model, like:
for insight in activeInsights:
# return insight only when all active insights have the same direction
if all(insight.Direction == other_insights.Direction for other_insights in activeInsights):
result[insight] = (insight.Direction if self.RespectPortfolioBias(insight) else InsightDirection.Flat) * percent
else:
result[insight] = (InsightDirection.Flat) * percent
I had understood that the activeInsights should be like in the docu
“The combined stream of Insight objects is passed to the Portfolio Construction model.”
so I thought the above code should do the trick.
However, it appears that all signals are treated and executed equally. I have attached a sample for demo purposes:
- only 1 Symbol (Ethereum)
- Alpha model up statically emits Up signals
- Alpha model down statically emits Down signals
- Daily Resolution
Can anyone give “insights” (no pun intended…) how to accomplish that?
Thx!
George Riley
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!