Back

Bounce Strategy

Although the compounding annual return is 2421.010% for the January to April of 2016 period, it should be noted that the algorithm is overfit for that time period. I optimized the algorithm using that time period. Backtesting run through 2014 and 2015 shows a much more modest compounding annual return of 69.422% for that time period. Conditions do change due to changing trading patterns from other algorithms and traders, which is an argument in favor of this algorithm.

Use entirely at your own risk!

The premise of the algorithm is simple, look for stocks with a high downward momentum and buy them on the bounce, when the most recent minute is higher than the minute previous to the most recent. Sell as soon as the stock turns downward again, when the most recent minute is lower than the minute previous to the most recent.

Custom algorithm development : warrencharding@yahoo.com.
Update Backtest








Thanks for sharing Warren! Looks like a nice setup you have here. Did a little digging around and discovered some things.

First off, I was able to aggregate the results by symbol to see who the big players are. Here are the results.

2016-04-30 00:00:00 TotalProfit: 50065.759500000000
2016-04-30 00:00:00 Ticker: UVXY, Total Profit: -438.20
2016-04-30 00:00:00 Ticker: XIV, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: NUGT, Total Profit: 239.89
2016-04-30 00:00:00 Ticker: DUST, Total Profit: 3,573.00
2016-04-30 00:00:00 Ticker: JNUG, Total Profit: 938.67
2016-04-30 00:00:00 Ticker: JDUST, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: LABU, Total Profit: 708.56
2016-04-30 00:00:00 Ticker: LABD, Total Profit: 6,215.35
2016-04-30 00:00:00 Ticker: GUSH, Total Profit: 4,972.54
2016-04-30 00:00:00 Ticker: DRIP, Total Profit: -1,411.80
2016-04-30 00:00:00 Ticker: TVIX, Total Profit: -2,009.74
2016-04-30 00:00:00 Ticker: GASL, Total Profit: 10,334.88
2016-04-30 00:00:00 Ticker: GASX, Total Profit: 11,773.34
2016-04-30 00:00:00 Ticker: DWTI, Total Profit: 5,433.01
2016-04-30 00:00:00 Ticker: UWTI, Total Profit: 1,742.18
2016-04-30 00:00:00 Ticker: DGAZ, Total Profit: 98.81
2016-04-30 00:00:00 Ticker: UGAZ, Total Profit: 726.20
2016-04-30 00:00:00 Ticker: UBIO, Total Profit: 1,017.29
2016-04-30 00:00:00 Ticker: ZBIO, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: BRZU, Total Profit: 215.68
2016-04-30 00:00:00 Ticker: RUSS, Total Profit: -178.78
2016-04-30 00:00:00 Ticker: SCO, Total Profit: 894.94
2016-04-30 00:00:00 Ticker: UCO, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: RUSL, Total Profit: 109.66
2016-04-30 00:00:00 Ticker: ERY, Total Profit: 72.59
2016-04-30 00:00:00 Ticker: ERX, Total Profit: -261.18
2016-04-30 00:00:00 Ticker: BIOL, Total Profit: -500.74
2016-04-30 00:00:00 Ticker: SVXY, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: VXX, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: SILJ, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: BIB, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: BIS, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: VIXY, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: SOXL, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: VIIX, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: SOXS, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: BZQ, Total Profit: 1,477.70
2016-04-30 00:00:00 Ticker: USLV, Total Profit: 283.92
2016-04-30 00:00:00 Ticker: SLVP, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: DSLV, Total Profit: -94.95
2016-04-30 00:00:00 Ticker: GDXJ, Total Profit: 0.00
2016-04-30 00:00:00 Ticker: GLDX, Total Profit: 0.00

Looks like GASX is the biggest contributor @ $11,773.34.

The kicker I found though is that when slippage is factored in, GASX goes from $11,773.34 to -$4,083.76. Using a 0.83% slippage spread found @ http://www.etf.com/GASX, most of the trades fail.

It's a bummer. Looks like a nice strategy. I wonder if boosting the resolution to 15m or 1h and adjusting your parameters would have better results. I've always found the 1m & 1s resolutions to tread dangerously close to the slippage zone.
0


Thanks for the interest Levitikon. I've been meaning to address the slippage issue. I can move to limit orders, I have a bunch of coding to do. I can then attempt purchasing close to the bid and selling close to the ask. That will put the spread on my side as LEAN analyses the highs and lows to see if my order gets through. Not all of my orders will go through so the number of trades will go down but my profit per trade will go up. I'll have to scrape the average spread values as well so it will take me a little while. Consider this algorithm a preliminary attempt.
0

Never surrender.

I switched to limit orders, that should take care of the slippage problem. The bounce strategy didn't work too well with the limit orders so I switched strategies altogether. The new strategy shows a compounding annual return of 6912.402%, but again the strategy is overfit for the time period.

If you see any more problems please report them here and I'll try and fix them. The algorithm is alpha so there may well be problems.
0


Hey Warren,

I wonder what this would look like if you used the universe down-select features the QC guys built for us. Would be pretty neat to be able to remove that static list of stocks in the initialization and just let the algo pick candidate securities for you.
0

I tried the universe code and couldn't figure out how to get a list of the securities in the universe from within the Initialize event. I need a list to set the fee models and indicators. There's probably a way but I didn't see it. I think there were some other events (OnSecuritiesChanged?) that I'll have to look into.
0

bravo, sir. bravo!
0

is there a way to follow up the development of this algorithm? versioning?
0

@Benton, I've mostly just been posting versions here as I get around to it.....
0

Very interesting algorithm! I am new to QuantConnect and algorithmic trading. Hope to learn from all of you guys. :)

0

Hi Warren, I could not get the 6912.42% by running the strategy. Where can I see the updated version of it? Cheers and thank you for sharing.
0

4.0.8. is below. It shows a compounding annual return of 9762.145%, but again it is overfit for the time period. It does make the top 1% of the community which isn't bad for an algorithm that addresses slippage and unrealistically large purchases.

0


how did you get the nifty data bar at the top of your backtest? really nice feature for seeing total equity, percent gain, fees, etc
0

@Eric, I didn't do anything special to get the data bar, I just selected the backtest with the combo box. Maybe QuantConnect just added that functionality recently.

1

@Eric its a feature called RuntimeStatistics :) By default we add a few key statistics, and you can add your own with:

SetRuntimeStatistic("Name", value);

https://www.quantconnect.com/docs#Runtime-Statistics

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.


Hello Warren and thanks for such awesome and simple code (in a good day, not minimizing)!... Let us know when you have or can share the version mentioned above, please. Thanks again for contributing with this!
0

Never mind. Your posting was on the second page. Apologies.

 

0

@jared when trying to run this code loive using paper trade for verification, it mentions that code can run only every 15 minutes due to a memory issue. If that's the case, this code would fail as it assuming and checking for the data of the last 1 minute bar, right?

I have printed the entire documentation and I will be reading. 

Thanks,

0

I am trying to run live (paper trade) this code for first time but I cant see why the error. It seems everytime is in a different location as per the log... In short, it runs the backtest but fails on live mode. 

0


-no value-
0

Also, I am using the previous version, the simple one, just to make it simplistic, since I am not able yet to find the issue when running live. It seems everytime is in a different spot. Did you ever put this to run live via the paper trading?

 

thank you guys!! awesome tool!!

0

No, I haven't tried it live via paper trading.

0

Has anyone tried this algorithm live and been successful yet?

0

I tested in paper trading for 3 months, 16.31% so far... Can be improved!

0

Update Backtest





0

The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.


Loading...

This discussion is closed