Hi There,
I'm working on an Alpha currently which emits insights indicating when a security should be purchased. This occurs when the security is trading at a price commensurate with the insight. (Ie. the insight indicates the security is currently to be purchased, within the timeframe of the insight).
Typically with a normal algorithm, I would place this order as a limit order. Once confirmed filled in OnOrderEvent, I would place another limit order to take profit - for the sake of argument say at the Fill Price + 10%. This order obviously sits for some time until filled, but one thing is certain - the prevailing market price does not meet the requirement to sell the security yet.
How do I emit insights for the profit taker? If I emit an insight when I place the limit order, I am emitting an insight at the wrong price. Can I emit an insight for the security to indicate a particular price?
Thank you
Derek Melchin
Hi Daniel,
Insights shouldn't be used to place take-profit orders. When implementing with the Algorithm Framework style, it's most appropriate for the take-profit order logic to be placed insight the execution model. To build a custom one execution model, refer to our documentation.
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.
Daniel Rose
Thanks Derek,
Just to clarify, I don't want to place a take-profit in the alpha model. I am more interested in understanding how I should model the insights. Is it required to emit a flat insight when we are no longer positive on the asset, or is it sufficient to emit a positive insight with a period that covers our expected or proposed holding period? (ie. which of the below is correct, or are both suitable in their own way - both assuming we expect the holding period to be 1 week)
Example 1 - Single Buy Insight
1 Jun: Emit "Up" Insight, Expected Duration 1 week
7 Jun: Do nothing
Example 2 - Buy Insight & Flat Insight
1 Jun: Emit "Up" Insight, Expected Duration 1 week
7 Jun: Emit "Flat" Insight
Derek Melchin
Hi Daniel,
Both examples will result in the same trades, but we recommend favoring example #1. Some users use a flat insight to exit a trade early. This would like like:
1 Jun: Emit "Up" Insight, duration 1 week
3 Jun: Emit "Flat" Insight, with a duration atleast a long as the remaining duration of the first insight
For more information on how to use Insights, refer to our documentation.
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.
Mark Hansen
Hi Derek,
Regarding “Insights shouldn't be used to place take-profit orders. When implementing with the Algorithm Framework style, it's most appropriate for the take-profit order logic to be placed insight the execution model.”
For take profit orders, is there a way I can place a limit order for my target price at the same time as my market order, but also have the limit order expire when the insight expires?
I wish the Insight would expire once the target magnitude was reached as well, but that does not appear to be the functionality.
Thanks!
Mark
Louis Szeto
Hi Mark
We can incorporate take profit by flat insight emitted within the alpha model. Please check this similar thread for implementation. Note that if the desired entry is by limit order, it has to be (1) implementing a customized portfolio construction model; or (2) set an if condition in the alpha model to emit the insight only when both the entry signal and entry price are desirable.
Best
Louis Szeto
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.
Daniel Rose
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!