Back

Competition Template: Energy ETFs

Hey Everybody,

We're excited to give the community the fourth demonstration algorithm of how to use one of the 5 ETF universes in the competition: Energy ETFs.

This algorithm provides a rough template of how this universe can be used in a submission and also implements some of the backtest requirements (5-year minimum, $1m starting cash minimum, and using the Alpha Streams brokerage model).

Some factors that tend to affect energy markets that you can consider when writing an algorithm:

  • Major news announcements: trade-war news, major geopolitical events, etc.
  • US Government data: manufacturing sector changes, changes in the construction industry, etc.
  • Analyst sentiment

P.S. -- Keep an eye out for new data sources regarding macro-economic updates, trade-war news, US Treasury data, and analyst sentiment to inform your trading signals!

Update Backtest






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.



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.


Here is the C# version of the demonstration algorithm using the Energy ETF universe!

1

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.


Hi,

thank you for the code.

I have to simple questions:

1)the Universe is composed of ETF or of stocks? It is not clear form the description.

2)Where are the ordered in the codes? I only see a self.EmitInsights(Insight.Price(symbol, timedelta(3), InsightDirection.Up)), but no actual order.

 

Thanks

JC

0

Hi Johnny,

The universes are composed exclusively of ETFs. The attached examples use Portfolio Construction and Execution models, which take the Insights emitted and convert them into position sizes and place orders. You can find more information about the Framework-style algorithms here.

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.


Hi All,

We know that not everyone likes using the Framework algorithms, so we've attached an example of how to build the universe easily using the AddEquity() API.

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.


Here's the C# version!

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.


Hi Jack,

thank you so much for both.

The portfolio construction process may be more under the programmer directr control using Addequity, but the Framework approach seems more integrated with the alpha stream creation, so thanks for both! I ll look into both.

In principle anything which can be done using Addequity can be done with Framework as well?

 

JC

0

"anything which can be done using Addequity can be done with Framework as well?" 100%. However, I highly recommend manually emitting insights with "EmitInsights" or using the framework which forces creating predictions, not just relying on passive insight signals of the trades which are hard to "reconcile". i.e. The institution will need to run its own backtests using the insight signals, thoughtfully emitting insights will ensure the backtests they run match the backtest returns in QuantConnect.

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.


HI,

where can I find the specification of all the classers and methods?

I cannot find a systematic soruce of information in the documentation. For example AddEquity, or EmitInsgihts?

For example what is the meaning of magnitude in EmitInsights? Is it a percentage value? Can it be negative? Or it si the execpted dollar value of the chnage , o its absolute value?

 

Thanks

JC

0

Hi Johnny, this is all covered in the docs?

QuantConnect.com/docs
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.


Hi, Can we use any other symbol(s) (e.g. 'AAPL' or multiple symbols) as a benchmark without trading it (of course)? For example, can we use 'AAPL' news as our benchmark? and all other data of 'AAPL' available in QC as well? (e.g. price, fundamental and so on.)

aapl = self.AddEquity("AAPL", Resolution.Hour).Symbol
self.aaplCustom = self.AddData(TiingoNews, aapl).Symbol

Also, what if we have empty data of the symbol from TiinggoNews? Should we include any lines such as 'if data.empty: return' ? Thanks.  

0

Yes it's fine to use assets as signals,



You could check if Tiingo is empty or just iterate on it when it has data

(as shown in demos)
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.


Hi Jqred;

I check carefully QuantConnect.com/docs  even before writing my post, but I cannot find the documentation and list of all available methods.

I can find something here https://www.quantconnect.com/lean/documentation/topic119.html which seems to be outdated, and systematic, but there is not link to these pages from QuantConnect.com/docs.

I dont think QuantConnect.com/docs is complete,

This is more a series a  briid tutorials, not a systematic documentation with all the available classes and objects, with documetatio about their use.

For example Addequity takes what arguments and does what?

Thanks

JC

 

 

0

Hi Johnny Cash ,

We recommend that you go through BootCamp to learn the basics since it is more straightforward than reading the docs. I have great news for you: we are about to add a bootcamp lesson on Framework Algorithms.

In fact, the explanation on the AddEquity method and which parameters it takes can be found at Initializing Algorithms section of the Algorithm Reference under Selecting Asset Data. When we click on the method names in bold red, a frame is opened with the full description.

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