Back

Correct Insight Use

Assuming my algorithm forecasts that a security x will rise for y hours; is this the correct way to emit this insight?

self.EmitInsights((Insight(x.Symbol, timedelta(hours=y), InsightType.Price, InsightDirection.Up)))

If so, is it correct to emit this insight before my algorithm places the order to purchase x?

When I wish to liquidate this holding, does the algorithm need to emit a further insight which indicates that the position will be flattened? And if yes, how is this done correctly?

 

Update Backtest







0

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.


Hey Kieran,

You are absolutely correct.
Insights need to be emitted before placing a trade. And a Flat Insight needs to be emitted with liquidate statements.
You can also specify other parameters like the magnitude of the insight, confidence, weight, etc when using the Insight() constructor.
For example,

Insight("IBM", timedelta(minutes=20), InsightType.Price, InsightDirection.Up, 0.0025, 1.00)

For price Insights, there is a helper method:

Insight.Price(ticker, timedelta, direction)

Learn more here about how EmitInsights work here:
https://www.quantconnect.com/docs/alpha-streams/upgrading-classic-algorithms#Upgrading-Classic-Algorithms-Converting-Classic-Algorithms
And learn more about creating insights here:
https://www.quantconnect.com/docs/alpha-streams/creating-an-alpha

Best,
Rahul

0

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.


Should InsightDirection.Flat be used to emit the flat insight?

0

Hey Kieran,
Yes, InsightDirection.Flat should be used to emit flat insights.

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed