Hi,
Here's another low capacity algo for you. You'll need to find more suitable stocks to trade a larger account. I do not recommend trading stock 'Y' with it as it is likely that a number of people are going to try that where I have published this script. That will likely ruin gains for that stock. I have a screener that can find suitable stocks.
This a mean reversion variant. I take the triangular moving average of the candle averages. Each of these candle averages is calculated by summing the open, high, low, and close and dividing by four. To calculate the distance from the tma to set the buy and sell points, I use half of the full range of the rolling window and subtract or add accordingly.
I have componentized the main calculations in the TMA2 class, so you can quickly copy and paste this component into more complex algos.
Use at your own risk.
Regards,
Warren Harding
Jared Broad
We have quote data coming soon :) Hopefully, we can give you realistic spreads on some of these low capacity algorithms.
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.
Warren Harding
Awesome news about the quote data. I have to try out the new debugging tools too.
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.
SLs
Hi, Warren Harding,
Thank you for this algo, this is really an example for me that quant trading is working.
Could you, please, explane how you do stocks screener , how to do search of suitable stocks for this algo, wat is important criteria to looking for ?
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.
Warren Harding
To screen, I calculate the returns on a per stock basis, then rank by returns. Note that there is a survivorship bias type of problem ingrained in this approach. However, you can keep an eye on the number of trades to overcome it. The backtest above has 894 trades. That's a fair size sample set which suggests that the pattern of price action with this stock has actually been suitable for the TMA2 approach.
Quantconnect does not easily let you see the returns on a per stock basis as best I know, but it can be done. You could use the trade log and recalculate the returns from that. Or you could do as I've done, I have a minimalist backtester that I integrated right into the Quantconnect script that lets me screen to see which stocks are behaving well for whatever strategy I want. That might not be the easiest approach but I have a proprietary minimalist backtester handy that I have already written. This approach gives me a lot of power where I can see which stocks have been behaving appropriately in recent time for any given strategy.
Much of the work is in the screening. TMA2 is actually a B-grade strategy kernel. I'm not for giving my best stuff away, sorry.
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 Chen
It's an amazing algorithm! I would recommend combining the universe selection and the TMA2 approach to get better performance. My idea is that we could apply the TMA2 trading logic on stocks filtered by coarse and fine selection. As long as the number of filtered symbols is set to be small in the universe selection, the backtest result actually reflects the return on a per stock basis. Let me know if you have better ideas, thanks!
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.
Aaron Tawil INVESTOR
Daniel Chen actually gave that a try - thinking the same thing and applying the boot camp to it. Still needs some tweaking to get right though. The algo I cam up with just seemed to buy and hold, so I am sure I am doing something wrong. But working on it. Would love to try and include an RSI alpha metric to also help make decisions.
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.
Warren Harding
Thanks Daniel. I'll consider your advice.
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.
Warren Harding
Hi Daniel. It sounds like you are suggesting something similar to what I have already done. I have a multi-stock version that can screen for suitable stocks as the backtest proceeds in a rolling like fashion. I could move the screening into a coarse selection function and that would eliminate the need for ticker lists. I'm using a high dollar volume ticker list right now.
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.
Valery T INVESTOR
Your algorighm does not re-invest the profits. Why?
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.
Warren Harding
Hi Valery. You can only trade so much before you'll run into problems with orders not being filled.
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.
Valery T INVESTOR
Hi Warren.
From your experience, does paper trading with IB reflect the real trades (orders being filled)?
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.
Warren Harding
I haven't used IB's paper trading platform.
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.
Douglas Stridsberg
Valery T IB paper trading is unlikely to demonstrate realistic execution of this algorithm. Toy algorithms like these (submitting arbitrarily tight limit orders and crossing your fingers they get filled) have been submitted before and should not under any circumstances be relied upon to produce profitable live trading. A simple test of robustness (change date range, tickers, fee assumptions, etc.) highlights how cherry-picked the range displayed in the original post is.
Please always do your own thorough research before committing any kind of capital to any kind of strategy, no matter how beautiful the backtest looks to be.
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.
Warren Harding
Hi Douglas, good to see you again. Unlike Beer Money, you can increase the period so the limit orders aren't so tight. It will still profit in backtesting. I chose the last year's date range deliberately as market dynamics change, with 894 trades being put through there is a fair size sample set just trading the last year. You can't just change the ticker, many stocks simply don't revert to the mean as this one does. I use the standard fees. You are right about being careful live trading any strategy, it may simply not perform as expected due to market reaction or some other reason. I still think you should start with exceptional backtests, then see which ones perform well live. Starting with a mediocre backtest is almost certainly going to bring you mediocre results.
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.
Ian Larson
https://www.quantconnect.com/alpha/59c617b46d2ecebdafb790c52 I've been meaning to ask @Douglas Stridsberg about that one. Obviously the equity curve was negative during backtesting so...must be some method to the madness? This one is nothing to sneeze at though: https://www.quantconnect.com/alpha/06bffa9edd7355cdaab263fb2
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.
Jared Broad
I encouraged the submission of Procyonoides. It has a solid core thesis and is mostly negative due to the retail spread of our data vs the algorithm concept itself. Institutions have a better ability to execute and access to different contracts so a consistent slope in either direction can still be a valuable signal.
The alpha stream thesis and research technique is more important than profitability. Many of the biggest funds are simply seeking predictable/reliable uncorrelated out of sample curves.
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.
Warren Harding
Now, THIS is an unrealistic backtest. 3131728331330290000% annual return! 1.3% drawdown! I was hoping to be so rich. Again. Too bad it utterly fails. When you lower the position sizing to a realistic value that considers what will actually fill, the algo fails. The fees rise relative to profits. And it suffers from slippage problems that are compounded by the high frequency (I built a limit order version, it doesn't work either). And it's showing exponential growth that isn't realistic given the fill limitations.
At 98.029% annual returns and 4.9% drawdown TMA2 isn't actually that impressive. It passes all of my reality checks though.
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.
Valery T INVESTOR
Hi Jared,
What are your criterias for selecting such algo?
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.
Hao Bin Zhang
Warren Harding does the interactivebrokermodel actively take into account slippage or model the impact of large market orders? Also, how can an algorithm achieve 16 Sharpe even if it is relatively high frequency! That is really amazing!
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.
Warren Harding
I haven't used the brokerage models as much as I should. I've been using limit orders more and more as I don't trust slippage approximations. Also high frequency trading generally fails due to the slippage adding up with market orders. The default setting does not model large order impacts, I've been keeping order sizes small to stay on the safe side. High frequency algos can definitely profit well, those small gains can really add up.
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.
Simone Pantaleoni
Here the framework algo
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.
Vladimir
Simone Pantaleoni,
Good idea and in line with my personal preferences.
Thank you for sharing.
Before we start to add on top of this framework we need to fix some existing problem.
1.Every line in orders log has Warning: fill at stale price.
Try to change resolution for stocks and bond from Daily to Hour.
And change
self.TimeRules.AfterMarketOpen("SPY")
to
self.TimeRules.AfterMarketOpen("SPY", 31)
This should solve the problem.
Good luck .
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.
Peter Guenther
Interesting project, looking forward to the discussion. Well done, Simone Pantaleoni and Strongs!
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.
Strongs
Hi all guys, this is just a base from which to start. The starting idea is to also exploit the concept of in & out and the intersection of ROC by Vladimir . The LEI could actually be exploited for a dynamic selection of ETFs, essentially identifying phases of the economic cycle and then selecting groups of ETFs that perform best in that specific phase of the cycle.
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.
Simone Pantaleoni
New version with the fixes from Vladimir 😊
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.
Vladimir
Simone Pantaleoni,
Completed as requested!
The second problem is that you have initialized the position in QQQ,
which is contrary to the main logic at the beginning of backtest.
To solve this. I define
To make self.mom visible on the chart changed self.MOM to self.MOMP
Here is "SIMON LesFlex" modified by Vladimir
with changes I mention above and some cosmetic changes.
Enjoy.
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.
Strongs
The idea would be to turn the indicator like that
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.
.ekz. INVESTOR
First of all, great work :)
I've had some time to look at this, and I want to be sure i'm interpreting it correctly...
Questions:
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.
Simone Pantaleoni
Hi .ekz. ! many thanks for appreciating it. :)
Let me try to answer your questions:
Questions:
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.
.ekz. INVESTOR
Perfect, Simone Pantaleoni. Thanks for this.
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.
Simone Pantaleoni
Hi guys!
As suggested, we have been working behind the scene on applying the concepts shared above about the different phases of the market. Based on that, we apply ETF-selection accordingly, out of a basket of sectorial ETFs (we kept a similar switch to shift to bond in case of possible market downturn using the leading indicator)
Some improvement on Total Return, sharpe and so on.
Feel free to work on this release, fix it in case I've made mistakes (here I rely on Vladimir as PeerReview :P ) and improve it (there's still something to optimize - but don't want to share all in once so… work on it and share your outcomes with us! :) )
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.
Strongs
Surely there is still a lot of work to be done, but this is definitely a great start. Levels for identifying the phases of the business cycle with associated ETF groups was presented. We await more ideas from you to improve it.
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.
Frank Giardina
Great stuff Guys thanks for sharing. I have a question and a comment. I have a Quandl free account have not used it much. I plugged in my key and started looking at the algo. My question is how does the self.history statement get the Quandl data to sync up with the start of the algo? i see the request for the 1400 bars, so does the Quandl request use the start date of the algo as it start retrieval date? I see the data frame adjusting to the different start dates I tried. Any clarification greatly appreciated.
My comment is i have been following a youtube channel Hedgeeye. The gentleman who runs the channel is an ex-Hedge fund manager who also uses a macro view of investing. He uses inflation and gdp rates of change for his strategy much like this algo uses the KEI data as leading indicators.. He uses ETFs like this algo but also uses different styles based on his macro view of 4 Quadrants. Depending on the Quads as he calls them he picks the ETFs and the investment style (Momentum, V:alue, High Beta, Low Beta etc.)
GrowthInflationQuad 1acceleratingslowingQuad 2acceleratingacceleratingQuad 3slowingacceleratingQuad 4slowingslowingA full explanation of his approach is on Hedgeeye.com, but here is a link to his strategy
https://app.hedgeye.com/insights/77156-chart-of-the-day-what-works-in-which-quad?type=macro
Frank
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.
Frank Giardina
Sorry, the grid got messed up when i pasted it
Quad 1 Growth accelerating Inflation slowing
Quad 2 Growth accelerating Inflation accelerating
Quad 3 Growth slowing Inflation accelerating
Quad 4 Growth slowing Inflation slowing
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.
Varad Kabade
Hi Frank,
History method takes the StartDate as the anchor retrieves data before it for the requested period. Refer to the following source code.
returns the last 1400 bars of history but we have the option to pass start and end dates to the History method.
returns the historical data for custom 90 day period.
Refer to the attached backtest, which demonstrates both approaches just comment out any one.
Best,
Varad Kabade
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.
Frank Giardina
Varad,
Thank you for the explanation now i understand
Frank
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.
Frank Schikarski
Hi there,
interesting stuff!!
Here are my 2 cents:
And the results using QQQ and TLT only:
Results using an amended version of Sector ETF's:
Results using an overfitted version of Sector ETF's:
Suggestions for the way forward:
Have fun,
Frank
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.
Tom Penrose
Expanding on Frank's work, I've added to the number of assets allocated depending on the regime.
I've attempted to replicate an asset allocation chart that I have which tells you where you should put your money depending on the trajectory of the economy.
For example, in a scenario of better than expected growth forecasted, it suggests allocating to 37% US equities, 18% non-US equities, 25% US-fixed income, 3% non-US fixed income, 13% alternative investments, and keeping 4% cash.
This doesn't translate perfectly to this strategy but I've done a crude implementation that follows more ETF's weighted based on this chart. For the US-equities component I've maintained the same sectors suggested in the previous version, only with different weighting.
The optimal implementation of this version of the strategy in my opinion would be to use universe selection to choose the best companies in each index, rather than following a whole sector. I think this would increase performance dramatically. Unfortunately, I'm not advanced enough to do this sort of dynamic universe selection.
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.
Simone Pantaleoni
Thanks to Frank Giardina and Tom Penrose for the good work and for moving the thread forward!
You're going on the exact direction I was meant to drive this discussion, when we've started it :)
I've been a bit busy lately on other projects, but next step will be exactly as Tom outlined, about stock-selection to pick up best 4-5 stocks for each sector.
Challenge there is to make the code decently quick, so I think a quite strict pre-selection of stocks will be needed
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.
Frank Giardina
I think we got the wrong Frank, I made some comments and certainly want to help but Frank Schikarski did more meaningful work with his post.
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!