Gekko Forum
[SHARE] Simple RSI BULL/BEAR strategy - Printable Version

+- Gekko Forum (https://forum.gekko.wizb.it)
+-- Forum: Gekko (https://forum.gekko.wizb.it/forum-13.html)
+--- Forum: Strategy Development (https://forum.gekko.wizb.it/forum-12.html)
+--- Thread: [SHARE] Simple RSI BULL/BEAR strategy (/thread-100.html)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38


RE: [SHARE] Simple RSI BULL/BEAR strategy - crypto49er - 10-03-2018

I would use an automated tool. Instead of testing the whole range, just test the bear markets. For ETH, that's like 5/2016 to 12/16 and obviously 1/18 - now. The higher time frames should make the tests faster.


The strategy works great... for the past - danibeni81 - 10-05-2018

First of all, sorry for the long message. I tried to keep it as short as possible. I think there are important conclusions worth reading...

After looking the backtest results presented by @tommiehansen I was really excited about this strategy, as probably everyone was or is.

But I quickly noticed that it is not always generating huge gains, it needs detailed adjustment of the parameters through backtesting.

So I decided to install the backtest tool and search for the optimal parameters.

I quickly noticed that not only the candle size but also the pairs selected affect the results importantly. Meaning that there must be optimal parameters for each pair and candle size. So I started looking for them.

After some tests I set the candle size to 15 minutes and start searching the optima for different pairs and different time frames.

To make the story short, I present here some key results that summarize my findings:

1) I optimized parameters for BTC-USDT from Nov. 21st 2017 to August 27th 2018. I did this semi-automatically, meaning that I searched for the best SMA long and short lengths, then moved to the RSI parameters bull and then bear and repeated the steps until finding the highest difference "simulated profit" minus "market". This optimization is of course not perfect and takes a lot of time, but if I let all parameters to variate simultaneously in the backtest-tool it will take forever.

2) With the obtained "optimal parameters" I selected another pair (e.g. ETH-USDT) and did one simulation. The results were not as good as for BTC-USDT. So I optimized that pair for the same time frame and candle size.

3) Then I optimized the parameters for all other pairs I found on binance starting on Nov. 21st 2017 which are: ETH, NEO, BNB and BCC.

4) The parameters obtained were always somehow similar to those obtained for BTC-USDT, besides BNB which had a very different trend during that time frame (very bullish).

5) Then I recalculated for BTC-USDT but using the parameters obtained for ETH, NEO, BNB and BCC

6) This is when it started to disappoint me. Although the parameters are not very different, the results are notably worst if "slight" changes are done. Attached you find the parameters I obtained as optimal for each pair and a matrix with the results by using the pairs optimum and other pairs parameter. I also used an "average parameters" by calculating the average of all pairs per parameters (besides BNB).

7) I also calculated the other way around: the pairs ETH, NEO, BNB and BCC with the optimal parameters of BTC-USDT

You can see the tables attached with the inputs and results. Just to explain one example: for NEO the market result (hodl) was -50,81%, with the optimized parameters I obtained 619% above that (or a profit of 568%), then just by selecting the parameters from the BTC-USDT optimization, the simulated profit of NEO is only 27% above the market. If that is not disappointing, then I don't know what...

[attachment=280]
[attachment=282]

I looked at it a bit closer in TradingView and my conclusion is that when the parameters are optimized by doing backtesting, it is then only good for the past behavior. The optimal parameters are found when long bull-runs are exploited and crashes are avoided. I noticed that this sometimes can be reached by only increasing e.g. the "RSI Bull low" from 30 to 32 and decreasing the "RSI bull high" from 75 to 70. Therefore, if we select other (slightly) different parameters, which were optimized for different charts, we will not match this strategic points, therefore reducing the profit considerably.

This means, that we can optimize as much as we want, but this will only lead to having the best parameters for the PAST price chart. Let the chart change a bit in the future, what it will do for sure, and the results can be very different.

This may probably be obvious to many people. But it wasn't for me before doing the work. I thought the strategy was "intelligent" enough to perform well in general after a long number of trades.
Now I understand how backtest results from Tommiehansen show profits of millions %: not only the market was good at those times, but also that he found the "perfect" parameters to exploit that specific market.

Notice that I selected quite a long time frame in order to increase the statistics and try to find generally good parameters. The next step to do I think is to search for optimal parameters during pure bull-trend and bear-trend and see how they differ. Then probably a result will be only to trade during bull-trend with special parameters for that.

If someone has similar experience or comments, critics or whatever I will appreciate your feedback. I put a lot of work into this and I think it is important to share and improve together.

cheers!


RE: [SHARE] Simple RSI BULL/BEAR strategy - crypto49er - 10-10-2018

@danibeni81,

Awesome explanation of your findings and extremely detailed work in your attempt to truly understand how this strategy work!

It's always good to hear people astounded by how well this strategy performs in backtests and then tried to truly understand this strategy by going into extensive testing to confirm the ideas.

Having said that, backtesting doesn't predict future performance, but lack of an actual working crystal ball to see the future, daytraders/swing traders/speculators in general look to the past (comparing the current bear market to 2014 post Mt. Gox time frame) for guidance. Backtesting is similar in that if the trend plays out in similar fashion, you should make better than market gains.

I haven't done much backtesting with this strat for some time, but the question of win rate % vs. gains (using the backtest tool by xFFFFF, doesn't work with Gekko 0.6x) was always a question that I never quite figured out. I couldn't find parameters that had high win rate (above 75%) and also made massive gains. I don't have a definitive answer but having worked with this strategy for quite some time, my general sense is this strategy when bias for gains is gambling every time it goes long by taking risky position that loses more often but wins big once in a while. When bias for high win rate %, the strat misses out on the losses but also misses out on the big gains.

Win rate isn't important if the strat performs exactly like it does in backtest, but we already know that's not possible as backtests can't predict the future absolutely. It also is extremely frustrating to see consecutive losing trades or 3 losing trades totaling 10% with a 1% gain stuck in between during live trading.

But back to your analysis, You have the right idea to backtest pure bull trends and pure bear trends. I believe that is closer to how expert day traders utilizes historical information to make their trades. You can also add in sideways trend to see if you can find profitable parameters for that as well.

One other thing you can do is instead of running backtest on the entire bull trend or bear trend period, just run it for 75% of the period first to find the optimal parameters. Then use those parameters on the remaining 25% to see if they actually work. Then try to find the optimal parameters for the remaining 25% and see if they differ from the 75% significantly. My guess (just based on my experience with market overall) is, for bull trends, the optimal parameters from the 75% won't perform as well compare to the 25%, because the latter part is  usually when the market gets extremely volatile and RSI move in extremes so the RSI highs won't capture the best gains. I want to say it's the inverse for bear trends but I honestly don't know.


RE: [SHARE] Simple RSI BULL/BEAR strategy - thaal - 11-01-2018

Is there a strategy that works well EU-BTC (or EU- whatever) ? All I've tried so far lead to loss and I pretty much went around most of them... They might require some tweaking beyond candle lenght which might be beyond my full understanding...


RE: [SHARE] Simple RSI BULL/BEAR strategy - ankasem - 11-01-2018

https://github.com/xFFFFF/Gekko-Strategies


RE: The strategy works great... for the past - tommiehansen - 11-15-2018

(10-05-2018, 08:56 PM)danibeni81 Wrote: First of all, sorry for the long message. I tried to keep it as short as possible. I think there are important conclusions worth reading...

After looking the backtest results presented by @tommiehansen I was really excited about this strategy, as probably everyone was or is.

But I quickly noticed that it is not always generating huge gains, it needs detailed adjustment of the parameters through backtesting.

So I decided to install the backtest tool and search for the optimal parameters.

I quickly noticed that not only the candle size but also the pairs selected affect the results importantly. Meaning that there must be optimal parameters for each pair and candle size. So I started looking for them.

After some tests I set the candle size to 15 minutes and start searching the optima for different pairs and different time frames.

To make the story short, I present here some key results that summarize my findings:

1) I optimized parameters for BTC-USDT from Nov. 21st 2017 to August 27th 2018. I did this semi-automatically, meaning that I searched for the best SMA long and short lengths, then moved to the RSI parameters bull and then bear and repeated the steps until finding the highest difference "simulated profit" minus "market". This optimization is of course not perfect and takes a lot of time, but if I let all parameters to variate simultaneously in the backtest-tool it will take forever.

2) With the obtained "optimal parameters" I selected another pair (e.g. ETH-USDT) and did one simulation. The results were not as good as for BTC-USDT. So I optimized that pair for the same time frame and candle size.

3) Then I optimized the parameters for all other pairs I found on binance starting on Nov. 21st 2017 which are: ETH, NEO, BNB and BCC.

4) The parameters obtained were always somehow similar to those obtained for BTC-USDT, besides BNB which had a very different trend during that time frame (very bullish).

5) Then I recalculated for BTC-USDT but using the parameters obtained for ETH, NEO, BNB and BCC

6) This is when it started to disappoint me. Although the parameters are not very different, the results are notably worst if "slight" changes are done. Attached you find the parameters I obtained as optimal for each pair and a matrix with the results by using the pairs optimum and other pairs parameter. I also used an "average parameters" by calculating the average of all pairs per parameters (besides BNB).

7) I also calculated the other way around: the pairs ETH, NEO, BNB and BCC with the optimal parameters of BTC-USDT

You can see the tables attached with the inputs and results. Just to explain one example: for NEO the market result (hodl) was -50,81%, with the optimized parameters I obtained 619% above that (or a profit of 568%), then just by selecting the parameters from the BTC-USDT optimization, the simulated profit of NEO is only 27% above the market. If that is not disappointing, then I don't know what...




I looked at it a bit closer in TradingView and my conclusion is that when the parameters are optimized by doing backtesting, it is then only good for the past behavior. The optimal parameters are found when long bull-runs are exploited and crashes are avoided. I noticed that this sometimes can be reached by only increasing e.g. the "RSI Bull low" from 30 to 32 and decreasing the "RSI bull high" from 75 to 70. Therefore, if we select other (slightly) different parameters, which were optimized for different charts, we will not match this strategic points, therefore reducing the profit considerably.

This means, that we can optimize as much as we want, but this will only lead to having the best parameters for the PAST price chart. Let the chart change a bit in the future, what it will do for sure, and the results can be very different.

This may probably be obvious to many people. But it wasn't for me before doing the work. I thought the strategy was "intelligent" enough to perform well in general after a long number of trades.
Now I understand how backtest results from Tommiehansen show profits of millions %: not only the market was good at those times, but also that he found the "perfect" parameters to exploit that specific market.

Notice that I selected quite a long time frame in order to increase the statistics and try to find generally good parameters. The next step to do I think is to search for optimal parameters during pure bull-trend and bear-trend and see how they differ. Then probably a result will be only to trade during bull-trend with special parameters for that.

If someone has similar experience or comments, critics or whatever I will appreciate your feedback. I put a lot of work into this and I think it is important to share and improve together.

cheers!


So basically your findings are that the optimal parameters are found when a longer bull run is detected?
Yes? The most profits is always to be had during longer bullish trends. Hence the idea behind RBB ADX.

My backtests are meager tests and proof of concepts. The backtests i posted before are not optimized in the slightest, the record is around 5-8 trillion % gain. Backtests that would be pointless to post since few seem to grasp what a backtest is and is not. Those would have been optimized and thus it would be a problem (not for me, but to post since people would expect unreasonable things).

I've also ran millions (literally millions) of backtests on data (e.g. USD/ETH, USD/XMR etc) dating back to 2016 (so 2016-01-01 to 2018-04-01). Often the stuff that works does work but it takes time. Most of the time the problem more has to do with the hype surrounding crypto in general and people expecting millions of returns in a week or two. Such things is often down to the failiure of actually looking at backtests and seeing the losing streaks a strategy can have (but to then gain a lot); not actually getting the data or studying what the data say.

Btw, simple params to start with for RSI BB ADX is long @ 300, short @ 50, rsi around 20 etc. This is especially true for more volatile assets in combination with USD e g USD/NEO, USD/XRP etc.
Also try with longer candles for more stability.


RE: [SHARE] Simple RSI BULL/BEAR strategy - kinakuta - 11-15-2018

@danibeni81
Thank you, great post and impressive work.

And yes, I agree, I would do different backtests for bear, bull and sideways time frames and compare shorter periods with longer ones. I would love to pitch in, but I'm currently too busy with work and kids to really spend a lot of time on backtesting Gekko strats. But I really appreciate you sharing your results.

Problem with backtesting is, it's only technical analysis, while there's no way to really backtest fundamental analysis. There is a tool that shows the correlation between google searches and BTC price movements, very interesting: https://www.a4dbull.com/p/blog-page.html

So as good as any TA can be, there will always be the next FUD, FOMO etc. triggered by some news, fake or real. We need to remember that the crypto market really is still in its infancy, we still need a lot more institutional money in the game to stabilize volatility in the long term.


RE: [SHARE] Simple RSI BULL/BEAR strategy - tommiehansen - 11-16-2018

(11-15-2018, 09:41 AM)kinakuta Wrote: @danibeni81
Thank you, great post and impressive work.

And yes, I agree, I would do different backtests for bear, bull and sideways time frames and compare shorter periods with longer ones. I would love to pitch in, but I'm currently too busy with work and kids to really spend a lot of time on backtesting Gekko strats. But I really appreciate you sharing your results.

Problem with backtesting is, it's only technical analysis, while there's no way to really backtest fundamental analysis. There is a tool that shows the correlation between google searches and BTC price movements, very interesting: https://www.a4dbull.com/p/blog-page.html

So as good as any TA can be, there will always be the next FUD, FOMO etc. triggered by some news, fake or real. We need to remember that the crypto market really is still in its infancy, we still need a lot more institutional money in the game to stabilize volatility in the long term.


Yep, the stuff regarding correlation between "other trends" such as e.g. Google Searches, Twitter posts.. etc.. is ofc interesting.
Problem is that any API would require historical data to test since requesting X each tick would be extraordinarily slow.
If extraordinarily slow we cannot backtest (fast) and thus show that X shows some promise.
Usually around 10 000x backtests are ok to conclude if something works or not.
Imagine 10k backtests when each backtest take 10 minutes to complete ......

Do note that the RBB ADX is mearly an idea of how one could attack a general problem. It, and it's parameters, are and should not be considered "final" in any way shape or form. If one want to improve it furher one should consider modifying the base strategy with additional logic. Many have probably done that but haven't shared the code. Smile


RE: [SHARE] Simple RSI BULL/BEAR strategy - embezon - 01-13-2019

I've a problem using this strat with Gekko. 
Gekko is running on a raspberry pi.

After starting in the logfile is written:
2019-01-13 12:00:53 (INFO): Setting up:
2019-01-13 12:00:53 (INFO): Trading Advisor
2019-01-13 12:00:53 (INFO): Calculate trading advice
2019-01-13 12:00:53 (INFO): Using the strategy: RSI_BULL_BEAR_ADX
2019-01-13 12:00:53 (ERROR): Failed to load indicator PDO
2019-01-13 12:00:53 (INFO): ====================================
2019-01-13 12:00:53 (INFO): Running RSI Bull and Bear + ADX
2019-01-13 12:00:53 (INFO): ====================================
2019-01-13 12:00:53 (INFO): Make sure your warmup period matches SMA_long and that Gekko downloads data if needed
2019-01-13 12:00:53 (INFO):

But in gekko/strategies/indicators the file PDO.js exists (copied from https://github.com/Gab0/gekko-extra-indicators)

What's the cause and how to resolve this?

Thanks! (and have a very nice trading day......)
Marco


RE: [SHARE] Simple RSI BULL/BEAR strategy - crypto49er - 01-14-2019

Open the PDO file to see if it is a valid indicator file.

You can also delete it unless you need it for another strat.