Hi,
Need some information about insights. I understand that in AlphaConstruction, in the update() method, we return the insight[] . However, I am getting confused in the time component of insight.
Here is the scenario,
- I raise a insight with timedelta as 5 hours, lets say for Stock XYZ with Direction.Up
- In the subsequent update call, i decide to sell XYZ stock within 1 hour so I do a Direction.Down insight now.
- However, now I see 2 order one that is long and the other one that has been short. All i wanted to do, was sell the first order. How do I accomplish that?
Derek Melchin
Hi Guru Selvaraj,
To liquidate the long position only, the second insight should have `InsightDirection.Flat`. Additionally, we need to ensure the duration of the second insight is long enough to cover the remaining duration of the first insight. See the attached algorithm for an 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.
Guru Selvaraj
Got it, Thanks!
Guru Selvaraj
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!