[SHARE] Simple RSI BULL/BEAR strategy
(05-18-2018, 07:14 AM)hoppy1969@hotmail.com Wrote:
(05-05-2018, 02:15 AM)crypto49er Wrote: All,

I just made a video explaining how the ADX version of this strategy works. I try to explain both in code and visually using Trading View. Hope this helps.

https://steemit.com/gekko/@crypto49er/t0olnilf

Thanks for making the video.  That helped me understand the strategy visually, and understand the code a little better.  I have been trying to figure out what code tells the Gekko to sell and you pointed it out.  I'm trying to get the RSI BULL_BEAR_ADX strategy going myself but getting some errors right now.  Thanks again for the video.

Glad you found it helpful.
If it isn't crypto, it isn't worth mining, it isn't worth speculating.
https://www.youtube.com/c/crypto49er
  Reply
(01-31-2018, 07:53 PM)tommiehansen Wrote: The general idea is quite simple: RSI between A and B works best in trend C but workes less great in trend D. So... use that knowledge to do A when B and C when D.

Works best with shorter duration candles in the ranges of 5-30 minutes but this of course depends on the pair. Please do your own backtests and please do not expect the default settings to always work.

This strategy has two variations, one simply called "RSI BULL/BEAR" and a modification called "RSI BULL/BEAR ADX". The latter is an improvement and most often yields better results since it adds logic to modify the RSI params when more rapid changes are detected using ADX (https://tulipindicators.org/adx). A simple way to test the strategy is to begin with the original (since it's faster because less params) and then use the ADX-version to improve upon the results.


---

Backtest samples


XRP-USDT, dec 2017 - jan 31 2018
https://i.imgur.com/4bcYnNm.png

XRP-USDT, 2016-10-15 - 2018-01-21
https://i.imgur.com/ZoUfeaT.png

ETH-USDT: 2016-01-01 - 2017-10-05
https://i.imgur.com/Yz0t4VN.png

NEO-USDT: 2017-12-01 - 2018-02-03
https://i.imgur.com/rqHjgyM.png

Note: These are only samples, one can of course yield better results with other parameters.
In some cases one can even create backtests results that has quite insane returns and makes
the above backtests look bad.


---

Instructions for use

1. Clone the repo:
git clone https://github.com/tommiehansen/gekko_tools.git
...or just download it from https://github.com/tommiehansen/gekko_tools

2. Copy JS-files e.g. RSI_BULL_BEAR.js to /gekko/strategies
3. Copy TOML-files e.g. RSI_BULL_BEAR.toml to /gekko/config/strategies
-
4. Versions after the 18th of march of the strategies also requires custom indicators, get here:
https://github.com/Gab0/gekko-extra-indicators
5. ...and add to gekko/strategies/indicators.


Running it live
Make sure Gekko downloads the necessary data needed. Else the strategy will be stuck in 'BEAR'-mode and won't trade.
Your Warmup period should reflect what you have set as SMA_long since the strategy will need that length of data in order to properly see if there's a BULL or BEAR trend.
Also make sure Gekko (check your console) tells you that it is downloading the necessary data before it starts running, you should get a message about this.

---

Q&A


Q: Adding a stoploss would be great
A: No, this has been tested several times and always gives less performance for quite obvious reasons.
-
Q: It did a bad trade
A: Yes, none of this strategies manages to always make good trades.
-
Q: When running live it does nothing
A: See 'Runing it live'
-
Q: It doesn't work
A: This is unrelated to the strategies, try another forum thread
-
Q: Using X instead of Y would be better
A: Maybe? Modify the strategy and share the results!

---

Download / latest versions

To get the latest versions goto (and modifications):
https://github.com/tommiehansen/gekko_to...strategies

...or just clone on your drive somewhere:
git clone https://github.com/tommiehansen/gekko_tools.git
 
I have downloaded the strategy, .toml files, and the extra indicators.  When I download the extra indicators do I also need to TALib-port-tester_ADX.js files as well?  If so, what file in GEKKO do those files need to be copied to?  Thanks.

v/r
Hoppy
  Reply
(05-20-2018, 02:00 PM)hoppy1969@hotmail.com Wrote: I have downloaded the strategy, .toml files, and the extra indicators.  When I download the extra indicators do I also need to TALib-port-tester_ADX.js files as well?  If so, what file in GEKKO do those files need to be copied to?  Thanks.

v/r
Hoppy

Hi Hoppy, you don't need the ..port-tester.. files.  I was confused by this initially too.

You only need the .js files in the indicators folder (ie. these -> https://github.com/Gab0/gekko-extra-indi...indicators)

Copy them into your strategies/indicators/ folder in the main Gekko folder.

The strategy itself goes into strategies/ folder

The .toml file(s) goes into  config/strategies/ folder

Hope that helps.
  Reply
Thumbs Up 
(05-18-2018, 04:48 PM)crypto49er Wrote:
(05-18-2018, 07:14 AM)hoppy1969@hotmail.com Wrote:
(05-05-2018, 02:15 AM)crypto49er Wrote: All,

I just made a video explaining how the ADX version of this strategy works. I try to explain both in code and visually using Trading View. Hope this helps.

https://steemit.com/gekko/@crypto49er/t0olnilf

Thanks for making the video.  That helped me understand the strategy visually, and understand the code a little better.  I have been trying to figure out what code tells the Gekko to sell and you pointed it out.  I'm trying to get the RSI BULL_BEAR_ADX strategy going myself but getting some errors right now.  Thanks again for the video.

Glad you found it helpful.

crypto49er your content is great.  I've learnt a lot from your videos too.  I highly recommended them to anyone following this thread!
  Reply
I have run multiple tests for over 1yrs worth of data and the ADX and the mod high/mod low really don't do anything from what I can tell unless you drastically change the numbers. Maybe I'm just missing something...
  Reply
(05-10-2018, 11:08 AM)Cryptos Wrote:
(05-10-2018, 04:05 AM)danidant Wrote:
(05-09-2018, 02:28 PM)danidant Wrote: (...)
2018-05-09 21:26:06 (INFO):              Using the strategy: RSI_BULL_BEAR_ADX
 xxx POST /api/backtest 500 267ms -

 Error: non-error thrown: Child process has died.
     at Object.onerror (/home/dani/gekko/node_modules/koa/lib/context.js:105:40)
     at <anonymous>
     at process._tickCallback (internal/process/next_tick.js:188:7)
(...)

help me about this please ...
I suppose you are using the UI.
This might be a problem with your warmup period? The warmup period has to be at least your SMA.long period.

In minutes ? if I use 15min candle, I need a warmup 67 ?
  Reply
(05-20-2018, 09:48 PM)coiner2018 Wrote:
(05-20-2018, 02:00 PM)hoppy1969@hotmail.com Wrote: I have downloaded the strategy, .toml files, and the extra indicators.  When I download the extra indicators do I also need to TALib-port-tester_ADX.js files as well?  If so, what file in GEKKO do those files need to be copied to?  Thanks.

v/r
Hoppy

Hi Hoppy, you don't need the ..port-tester.. files.  I was confused by this initially too.

You only need the .js files in the indicators folder (ie. these -> https://github.com/Gab0/gekko-extra-indi...indicators)

Copy them into your strategies/indicators/ folder in the main Gekko folder.

The strategy itself goes into strategies/ folder

The .toml file(s) goes into  config/strategies/ folder

Hope that helps.

Perfect...thank you.
  Reply
Hey guys, just wondering if it's possible to enable debug mode for this strategy to appear in pm2 logs when running gekko in CLI mode. 

What I'm looking for are the 'Long/Short since x candles' messages.

I've tried change the RSI_BULL_BEAR_ADX.js code to the below but it doesn't work. 

Code:
        // debug? set to false to disable all logging/messages/stats (improves performance in backtests)
        this.debug = true;
        
        // performance
        config.backtest.batchSize = 1000; // increase performance
        config.silent = false;
        config.debug = true;
  Reply
(05-23-2018, 01:21 AM)gt3 Wrote: Hey guys, just wondering if it's possible to enable debug mode for this strategy to appear in pm2 logs when running gekko in CLI mode. 

What I'm looking for are the 'Long/Short since x candles' messages.

I've tried change the RSI_BULL_BEAR_ADX.js code to the below but it doesn't work. 

Code:
        // debug? set to false to disable all logging/messages/stats (improves performance in backtests)
        this.debug = true;
        
        // performance
        config.backtest.batchSize = 1000; // increase performance
        config.silent = false;
        config.debug = true;

Never mind. It was working, just took some time to come through.
  Reply
I've been running RBBADX in trader mode for a few weeks. Although I have managed to find parameters that give encouraging backtest results, in real trading, it has yet to make one good trade. Bad trades, oh yes, lots of those, it lost me a quarter of my money. It's been a bearish and sideways market, true. But still.

My problem is that it won't buy on a bull trend. It just sits stupid.

But selling, it does. Real quick, whenever it sees some minuscule drop, it can't sell fast enough.

These are the parameters that I'm currently using. I've been adjusting them continuously, but the not-buying-when-the-time-is-right behavior hasn't improved . Does anyone has a suggestion where I should investigate to make it buy on a bull trend? It was oblivious to a 10% price increase in 3 hours!

20 minute candles, that's the most efficient in backtests on this particular market. Backtest for 3 months data shows 88% gain.

Thank you

Code:
config.RSI_BULL_BEAR_ADX = {
 "SMA": {
   "long": 251,
   "short": 21
 },
 "BULL": {
   "rsi": 21,
   "high": 81,
   "low": 40,
   "mod_high": 5,
   "mod_low": -5
 },
 "BEAR": {
   "rsi": 14,
   "high": 41,
   "low": 19,
   "mod_high": 14,
   "mod_low": -5  
 },
 "ADX": {
   "adx": 2,
   "high": 83,
   "low": 55  
 }
}
  Reply


Forum Jump:


Users browsing this thread: