As of this writing this algo is ranked #1 and is in the top 1% of the community.
It's a crypto algo. GDAX charges high fees for 'takers', and there is no fee modelling. It will have to be appropriately converted to limit orders in order to take advantage of GDAX's zero fee for 'makers' fee model in order to actually be useful. Slippage is low on GDAX for the instruments in question so that shouldn't have too much of an impact.
Warren Harding
Framework Description
The framework allows experimentation with, and utilization of, two fundamental properties. Those properties are trend and curvature of price. For example you may wish to select instruments that have been trending downwards and curving upwards, or some other mix of trend and curvature. The changes1Ratio variable determines the influence of trend. A positive changes1Ratio will increase the tendency to select instruments that have been trending upwards, a negative changes1Ratio will increase the tendency to select instruments that have been trending downwards. The changes2Ratio variable determines the influence of curvature. A positive changes2Ratio variable will increase the tendency to select instruments with a price that has been curving upwards. A negative changes2Ratio will increase the tendency to select instruments with a price that has been curving downwards. You can also set either the changes1Ratio or changes2Ratio variable to zero. This will eliminate the influence of that variable. So if you just want to select based upon trend with no regards to the curvature you would set the changes2Ratio to zero. Magnitude has the obvious effect. A large magnitude of changes1Ratio combined with a small magnitude of changes2Ratio will produce an algorithm that mostly considers trend with regards to instrument selection. Both the trend and curvature considerations are exponential in nature. So more recent events will have a higher influence upon selection than older events.
The emaOfChanges1Indicator indicator is the primary indicator of trend. It holds an exponential moving average of the changes in price. You can change it's length by adjusting the emaOfChanges1Length variable. The emaOfChanges2Indicator indicator is the primary indicator of curvature. It holds an exponential moving average of the change in change of price. You can change it's length by adjusting the emaOfChanges2Length variable.
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.
Jack Pizza
Hey Warren,
Have you tried trading the strategy with other instruments? Just wondering it's robustness, I have another strategy that works great on crypto but not so well on other instruments. Meaning the crypto community might be naive and technical indicators and strategies still have high impact.
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 Elsid,
Ya, crypto is a newer space for algo developers so I've been looking at it as an opportunity before it's swamped with more refined analysis. I do have a volatility algo that operates on similar principles as the framework here, It profits well. Results with equities might be less than stellar. Fundamentals seem to do well there.
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 Jared,
I see you changed the headline for me. Thanks, except that it's not an EMA cross. It might be better described as a buy the dip algo. Or, as I've called it, 'the framework'. Or simply a 'crypto algo'.
Hello everyone,
I'll explain more thorughly how the algo operates. It doesn't really have a name because it operates on principles that I invented myself. I may not be the original inventor but I haven't seen these principles in common use. The primary trend indicator calculates the ema of the percentage changes in price. Note that it's an ema of percentage change in price, not the usual ema of price. This allows one to assign a single number to 'trend'. This number is based upon percentage change in price, so you can readily compare with other instruments to find the instruments with highest or lowest trend. Because it's an ema, more recent changes have a greater influence than less recent changes. The primary curvature indicator operates in similar fashion, but it takes an ema of the change in change of price.
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
How's that? ;) Fixed 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.
Warren Harding
Excellent. Thanks Jared!
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.
Nick Georgiadis
Hey Warden,
I converted it to limit order but the return has a significant drop compared to the initial one. Any idea what might have affected the algo?
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.
Warren Harding
Hi Nick,
A few things come to mind, though I haven't examined your algo in detail. The Liquidate call will have to go as well, it uses market orders as I understand it. You might want to cancel the limit orders if they don't go through, possibly after some amount of time. This could be why the returns have come down so much, though I haven't checked thoroughly. I'ld have just used the bid price for purchases and the ask for sales given the behavior of the instruments on GDAX. If you go to the GDAX exchange you'll see that there is practically no spread. If you set a limit order at the ask for a purchase I'm not sure if you'll meet the 'maker' requirement for fees on GDAX, which is going to be critical for this 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.
John Schwartz
Has anyone figured out a good algo for GDAX maker orders for this 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.
Skyfold
Hello everyone,
I attempted to launch the code "live" at OANDA, but it gives the following werrror. Could any one tell me what is missing in the code to go live?...Thank you!
Failed to initialize algorithm: System.Exception: No default market set for security type: Crypto at QuantConnect.Algorithm.QCAlgorithm.AddSecurity[T] (QuantConnect.SecurityType securityType, System.String ticker, QuantConnect.Resolution resolution, System.String market, System.Boolean fillDataForward, System.Decimal leverage, System.Boolean extendedMarketHours) [0x00036] in <321054ea1e964454bc0d403925dda91a>:0 at QuantConnect.Algorithm.QCAlgorithm.AddCrypto (System.String ticker, QuantConnect.Resolution resolution, System.String market, System.Boolean fillDataForward, System.Decimal leverage) [0x00001] in <321054ea1e964454bc0d403925dda91a>:0 at QuantConnect.MultiCoinFramework.Initialize () [0x00067] in <0e4d1f8fc06a43f2a3bc45c24a3f6958>:0 at QuantConnect.Lean.Engine.Setup.BrokerageSetupHandler+<>c__DisplayClass24_0.b__1 () [0x000fb] in <7a802d713401490dbae6b34efb125c68>: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.
Jared Broad
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.
Casey Barclay
Has anyone had any success live trading this on GDAX? I'd be curious to see how the actual results pan out with a market order or even a limit order.
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.
Michael Manus
hi Alexandre Catarino & Jared Broad
i wanted to play around with warrens code and see how it behaves with stocks but got a runtime error.
1) could you please help me find it? IT DIES ON
2017-03-21 00:00:00 :Runtime Error: Cannot perform runtime binding on a null reference
edit the date first!!!!!!!!!
2) where did the VRX data go? :)
thx
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.
Samuel Cutler
I have tried to run a similar stragety live, and it buys the sells the first order great, but when it goes to buy the second it says invalid because of insufficient buying power, Does anyone have any ideas?
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.
Thushara Silva
As of this afternoon, the strategy does not work if more than 1 crypto is in the string. Was working fine from yesterday through this afternoon. If 2 only are on the list, ETHUSD, BTCUSD or BTCUSD, ETHUSD, the 2nd listed pair will fail with this error:
Runtime Error: 'BTCUSD' wasn't found in the Slice object, likely because there was no-data at this moment in time and it wasn't possible to fillforward historical data. Please check the data exists before accessing it with data.ContainsKey("BTCUSD") (Open Stacktrace)
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
This algo now fails! I hacked in a quick 'data.ContainsKey' and 'continue' thinking that would solve the problem and the returns dropped dramatically. Anyone at Quantconnect know what happened? Sounds like odd behavior given Thushara's report.
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.
Michael Manus
Warren i think Jeremy might found the problem.
data is null so the indicator and everything might be dead?
you could of course write to support@quantconnect :)
my english is really bad :):) hehe
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.
Johannes Mauritzson
Some temporary data issue? seemed to impact the algos which subscribed to more than one pair.
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
It seems to be working again.
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.
Johannes Mauritzson
Nevermind OP's code works if you add the actual ticker string instead of the Symbol:
Symbol symbol = QuantConnect.Symbol.Create(ticker, SecurityType.Crypto, Market.GDAX); AddCrypto(symbol, resolution); //Change to: AddCrypto(ticker, resolution); //You also need to set the brokerage model to GDAX in init: SetBrokerageModel(BrokerageName.GDAX, AccountType.Cash);
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.
HughStryker
Thanks for the update!
I'm happy that Jovad included an options straddle, as I was planning to replace VXX in the Dragon portfolio with a rolling straddle on SPY to serve as the long vol component. As I haven't used options in QC before, Jovad's algo is very useful as a starting point.
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.
Sairaj Patil
This is amazing 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.
Jovad Uribe
Hi everyone,
This week Derek built a strategy he heard on episode #10 of the Better System Trader podcast. The guest, Perry Kaufman, explained the strategy idea came from George Douglas Taylor in the '50s, but Derek reversed the strategy rules. The strategy trades IWM and QQQ, and the backtest can be viewed here. It generates a 0.845 Sharpe ratio and a drawdown of 2.7% when backtested over the last several years.
Adding this strategy to the InternFund algorithm increases the diversification as we do not currently trade IWM or QQQ. Although the historical Sharpe ratio decreases slightly from 1.931 to 1.902, the compounding annual return increases from 6.845% to 7.019%, and the max drawdown decreases from 3.8% to 3.3%. With this new deployment, our backtest has a max drawdown of just $1,379. This deployment (with an increased max drawdown limit) is attached below.
Shile also built a Risk Parity strategy inspired by this article. During his research, he noticed that the drawdown was a whopping 43.4%, outlined in this backtest. To reduce this drawdown, the effects of risk parity were increased by shorting TBT, a -2x 20+ Years ETF, which gives us a positively leveraged position. Then, the dip of SPXL was bought, then sold using the Risk Management inspired by this Strategy Library Addition. See the results of the strategy here.
Previously, Ernest mentioned that our 60:40 strategy would exceed a 100% allocation ratio. We added an update to this strategy ensuring that it does not exceed this ratio. The line we updated is:
quantity = self.CalculateOrderQuantity(ticker, weight * self.SF_AR / sum(self.weight_by_ticker.values()))
Tamim Fund pointed out that our Fibonacci Option Straddle was primarily purchasing Apple. We converted the strategy to the algorithm framework and added a dynamic universe selection model to remove look-ahead bias. To further clarify the strategy's logic, if the market sentiment of a stock is down, the bid price for the call option will decrease and fall below the retracement level, causing a sell. If market sentiment is up, then the bid price may cross above the retracement, causing a buy. Many TA traders use this strategy, but their execution may take some time. The strategy attempts to enter the same position but quicker. I have attached the backtest here. As we cannot implement this in the InternFund, we will not continue with it.
As for the InternFund's performance, here is a screenshot of our latest track record.
This week our strategy lost 0.099276% of its value while SPY gained ~1.8%. Although this is a small setback, we aim to improve our algorithms alpha of 0.067.
Our backtest produces a whopping Treynor ratio of 2.298. It is no surprise that this ratio is high because the current risk-free rate (10YR Treasury Rate) is at a low 0.69%, and our beta of 0.031 is also low. However, this is one indication that our algorithm is a worthwhile investment.
Thanks for tuning in for this week's update. Constructive criticism and feedback help us build better strategies for the fund. Stay tuned for more updates!
Cheers,
Jovad Uribe
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.
Shile Wen
Hi Everyone!
We are planning on continuing the InternFund past summer!
This week, we are allocating 5% of our portfolio to Taylor Robertson’s post on using Leveraged ETFs. This led to a .4% decrease in drawdown as well as a 1.7% increase in the CAGR. Furthermore, our strategy is now very close to a Sharpe of 2.0, sitting at 1.98. After that, we increased the ratios of our existing strategies to take advantage of the cheap leverage offered by IB, and the new deployment algorithm is attached below.In addition, I also implemented a very simple seasonal strategy described in this article, and the results can be seen here. The high drawdown of 11.4% did not justify the returns of only 4.356%, so this strategy will not be making it into our InternFund algorithm.
Derek implemented an ETF rotation strategy that was sourced from RotationInvest. During each monthly rebalance, it calculates the trailing 3-month Sharpe ratio of SPY, EFA, and GLD. For the top-ranking ETF, it'll invest in it only if it's trading above its 150-day simple moving average. Otherwise, it allocates 100% of the portfolio to a bond ETF (TLT).
When backtested since 2015, this strategy generates a 1.218 Sharpe ratio and an annual standard deviation of 0.118. By comparison, the S&P 500 produces a 0.712 Sharpe ratio and 0.185 annual standard deviation over the same period. See the backtest results here. We will add this strategy to the deployment algorithm next week.
Furthermore, Jovad implemented the Golden Butterfly Portfolio from this article in this backtest. After a few alterations, he achieved a relatively low drawdown at 4.4% and a CAGR of 3.9%, and the updated backtest can be found here. Unfortunately, when added to our algorithm, the drawdown increases while the CAGR decreases (backtest), so it will not be making it into our live deployment.Our updated track record can be seen here:

And we are only $1 away from a new equity high!
Best Regards,
Shile Wen
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.
HughStryker
Thanks for the update, Shile. What the InternFund is doing is very cool and I'm learning a lot.
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.
Derek Melchin
Week 7: A Little Turbulence
Hi everyone,
The InternFund had a sharp increase in volatility this week. However, we are still within our allowed max drawdown of $1000. Here's an image of our live track record over the last 7 weeks.
This week, we built a few more strategies with the hope of adding more to the InternFund algorithm.
Shile worked on a trend following strategy that measured the strength of the trend using an Ordinary Least Squares (OLS) model. When the past 50 days of close data have an r2 > .7, and the (current price - the average of the absolute values of the residuals) is at least the predicted value from the OLS model, we hold SPY, else, we liquidate our position. This model only had a Sharpe of .475 with a large drawdown of 34.2%, so this strategy will not be making it into the InternFund. The backtest can be found here.
I built a strategy that was inspired by Scott Andrews (aka "The Gap Guy"). Each market open, it fits a linear regression model using overnight gaps as the independent variable and the open-to-close returns as the dependent variable. It trains the model using the previous 10 weeks of data, using only weekdays that match the current trading day. After the model is trained, it predicts the direction of the current day's intraday return given the overnight gap and places its trade. The strategy achieves a 0.488 Sharpe ratio when backtested since 2015. See the backtest for reference. Since this strategy underperforms our benchmark, we didn't integrate it into the InternFund algorithm.
I also built a strategy I sourced from InvestiQuant that takes advantage of the long-bias in traders after a bull market breakout. Whenever the SPY has a multi-month breakout during a bull market rally but then gaps down into the next open, the strategy longs from the open until 15 minutes before the close. Backtesting the strategy since 2015 generates a 0.991 Sharpe ratio, outperforming the buy-and-hold Sharpe ratio of 0.742. See the backtest results here. After integrating this strategy into the InternFund algorithm, the Sharpe ratio of the algorithm backtest increases from 2.103 to 2.161. See the attached backtest for a copy of our latest deployment (with an extended drawdown limit).
In regards to the ETF rotation strategy we published last week, there was actually a bug in it. Line 71 should have read
if data[top_symbol].Price >= sma:
instead of
if data[symbol].Price >= sma:
After fixing this, the strategy underperforms the SPY, so we did not add it to our live deployment.
Thanks for tuning in for our weekly update!
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 Reeve
Hi guys,
I am wondering is it possible to combine several strategies like this using the algorithm framework?
Is there a reason you chose to avoid using the Algorithm Framework, other than simplicity?
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.
Shile Wen
Hi Mark,
It would be possible to combine these strategies using the Algorithmic Framework, however, we chose to stick with the classic algorithm because it is easier to account for multiple strategies.
From my experience, an algorithm developed using the Algorithmic Framework is best suited to a single signal type, however, our algorithm is a Frankenstein’s monster of various strategies that aren’t related. If we were to divide up our algorithm strategies into separate projects, then it would totally be viable for us to use the Algorithmic Framework on the strategies individually.
Best,
Shile Wen
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.
Samuel Schoening
You guys have helped me a lot so I just wanted to reach out and make sure you know that the orders for VXX may not be executing as you go back in history. This is because the price was over 30,000 in 2010 due to countless splits. Same goes for UVXY. The data is not adjusted so the order will not fill. That is why I just trade with 1 or 100 billion dollars in my backtests lol. With that said, this is very compelling research and do please keep up the good work!
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.
Josh M
It has been a few months -- any live trading update from the intern team?
Cool project and great work!
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.
Zicai Feng
hey interns, your self.max_dd is a fixed amount, should change it to a ratio as a % of the portfolio value. Because as your portfolio gets bigger due to profitable trades, a fixed amount that was set during a smaller AUM will just terminate your strategy randomly. I am sure Jared would understand and let you risk a fixed % of AUM rather than a fixed dollar amount with a fluctuating n growing AUM
Keep up the good work and build those RenTech libraries!
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.
Derek Melchin
Hi Zicai,
Thank you. We will adjust the drawdown limit if the InternFund is launched again this summer.
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.
Zicai Feng
Hope it gets launched again :). Btw, similarly, your stop loss limit in your tesla example is a fixed amount. Similar reason to above, it should be a % number not a fixed $ amount as tesla price is all over the place depending on the price of dogecoins
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!