[SHARE] Simple RSI BULL/BEAR strategy
(07-06-2018, 02:03 PM)IPhantom Wrote: Hi there,

i tried the following with the first quarter XRP/EUR at candle size 15 with warm up x10. It made +255% while the market went -76%.
Admitting i have no clue what i did, i just tweaked the values. Thoughts?

Code:
[SMA]
long = 1100
short = 30

[BULL]
rsi = 20
high = 80
low = 60
mod_high = 5
mod_low = -10

[BEAR]
rsi = 15
high = 45
low = 20
mod_high = 20
mod_low  = -10

[ADX]
adx = 2
high = 70
low = 50

in live or paper trading or back testing?
  Reply
[/quote]
in live or paper trading or back testing?
[/quote]

Backtest. It's the first quarter of 2018.
  Reply
Hi,

i am new to Gekko and copied this Code (RSI_BULL_BEAR) as descriped, but I dont get any Backtest Values.
Even the Parameters are not loaded in the Parameters Box.
When I copy them to it and try some settings (even with very long Warmup >1100) I dont get any Backtest data.

Even the log returned no error.

Other strategies (RSI, MACD) returns data.

Any Idea?

kind regards, Nils
  Reply
(07-03-2018, 08:49 PM)crypto49er Wrote:
Quote:None for me, so far.
It's all great in backtests, but, in live trading, at the bottom line, I've lost almost half my money. Having lots of fun though, trying to make them back Smile
Ouch, hope half wasn't too much. How long did you have the bot running?
It just lost me almost 10% of my money, all in just one bad trade.

Look at the screenshot, it bought high and sold low. My parameters are conspiring against me, they are taking my money. These are the parameters that make 30% gains in 3 months, supposedly. I've been running live for a month, I'm down 10%, just because of this single last trade.

Code:
[font=monospace][color=#000000]config.RSI_BULL_BEAR_ADX = { [/color]
 "SMA": {
   "long": 248,
   "short": 21  
 },
 "BULL": {
   "rsi": 14,
   "high": 85,
   "low": 40,  
   "mod_high": 5,
   "mod_low": -5  
 },
 "BEAR": {
   "rsi": 14,
   "high": 41,
   "low": 19,  
   "mod_high": 14,
   "mod_low": -5   
 },
 "ADX": {
   "adx": 3,
   "high": 83,
   "low": 55   
 }
}
[/font]
Since I have debugging active, let's see what it did:

Buy:
Code:
[font=monospace][color=#000000]2018-07-09 12:37:52 (INFO):     - - - Begin check function - - - [/color]
2018-07-09 12:37:52 (INFO):     maSlow: 114.7845564516131 maFast: 117.59619047619067 ADX: 71.38793663577
546
2018-07-09 12:37:52 (INFO):     Bull maFast: 117.59619047619067 > maSlow: 114.7845564516131
2018-07-09 12:37:52 (INFO):     Bull RSI: 31.07766688224133 bull high: 85 bull low: 40
2018-07-09 12:37:52 (INFO):     RSI: 31.07766688224133 < RSI bull low: 40 calling long function
2018-07-09 12:37:52 (INFO):     We have new trading advice!
2018-07-09 12:37:52 (INFO):              Position: long
2018-07-09 12:37:52 (INFO):              Market price: 115.54
2018-07-09 12:37:52 (INFO):              Based on market time: 2018-07-09 09:32:00
2018-07-09 12:37:52 (INFO):     Trader Received advice to go long. [color=#ffffff]Buy[/color][color=#000000]ing  ***[/color]
2018-07-09 12:37:52 (DEBUG):    portfolioManager : newTrade() : creating a new Trade class to  [color=#ffffff]BUY[/color][color=#000000] *** /[/color]
***
2018-07-09 12:37:52 (DEBUG):    created new Trade class to [color=#ffffff]BUY[/color][color=#000000] ***/***[/color]
2018-07-09 12:37:52 (INFO):     Going long
2018-07-09 12:37:52 (INFO):     Long since 1 candle(s)
2018-07-09 12:37:52 (INFO):     - - - End check function - - - -
[/font]

Sell:
Code:
[font=monospace][color=#000000]2018-07-10 18:14:43 (INFO):     - - - Begin check function - - - [/color]
2018-07-10 18:14:43 (INFO):     maSlow: 114.29649193548404 maFast: 106.06809523809541 ADX: 36.5658920056
8533
2018-07-10 18:14:43 (INFO):     Bear maFast: 106.06809523809541 < maSlow: 114.29649193548404
2018-07-10 18:14:43 (INFO):     Bear RSI: 41.602778123877656 bear high: 41 bear low: 19
2018-07-10 18:14:43 (INFO):     ADX: 36.56589200568533 < ADX_low 55
2018-07-10 18:14:43 (INFO):     RSI bear low: 19 + bear mod_low -5
2018-07-10 18:14:43 (INFO):     RSI bear low new value: 14
2018-07-10 18:14:43 (INFO):     RSI: 41.602778123877656 > RSI bear high: 41  calling short function
2018-07-10 18:14:43 (INFO):     We have new trading advice!
2018-07-10 18:14:43 (INFO):              Position: short
2018-07-10 18:14:43 (INFO):              Market price: 105.75
2018-07-10 18:14:43 (INFO):              Based on market time: 2018-07-10 15:12:00
2018-07-10 18:14:43 (INFO):     Trader Received advice to go short. Selling  ***
2018-07-10 18:14:43 (DEBUG):    portfolioManager : newTrade() : creating a new Trade class to  SELL ***
/ ***
2018-07-10 18:14:43 (DEBUG):    created new Trade class to SELL ***/***
2018-07-10 18:14:43 (INFO):     Going short
2018-07-10 18:14:43 (INFO):     Short since 1 candle(s)
2018-07-10 18:14:43 (INFO):     - - - End check function - - - -
[/font]
  Reply
@dugu-dugu

This is supposed to happen as the trend switch from bull to bear, so this trend switch sell acts like a stop loss. Considering the market is still dropping, the strat should have saved you from further losses, although 10% is a a bit rough.

@hondong

Did you add the TOML file in the correct location? That's usually the reason why you don't see any parameters in the parameters section when running UI.
If it isn't crypto, it isn't worth mining, it isn't worth speculating.
https://www.youtube.com/c/crypto49er
  Reply
(07-10-2018, 10:12 PM)crypto49er Wrote: @dugu-dugu

This is supposed to happen as the trend switch from bull to bear, so this trend switch sell acts like a stop loss. Considering the market is still dropping, the strat should have saved you from further losses, although 10% is a a bit rough.

@hondong

Did you add the TOML file in the correct location? That's usually the reason why you don't see any parameters in the parameters section when running UI.

Hi @crypto49er,
thanks, that was a beginner fault.  Rolleyes 
now, i get results.

kind regards, Nils
  Reply
(07-10-2018, 10:12 PM)crypto49er Wrote: This is supposed to happen as the trend switch from bull to bear, so this trend switch sell acts like a stop loss. Considering the market is still dropping, the strat should have saved you from further losses, although 10% is a a bit rough.
Yes, I know that's what it's supposed to do, what I was trying to say was that it reacts too slowly. This is the screenshot that I forgot to attach.

I would want to try to replace Simple Moving Average with Exponential Moving Average or DEMA for faster reaction, but I have zero node.js experience, just general old school programming. It shouldn't be so difficult, I'll keep looking at the code.


Attached Files
.png   Screenshot_20180710_222741.png (Size: 49.27 KB / Downloads: 83)
  Reply
If you just want to switch from SMA to EMA, just go into the strat file and do a find and replace. DEMA works differently so you will have to change the code in the strat a bit to get it to work.
If it isn't crypto, it isn't worth mining, it isn't worth speculating.
https://www.youtube.com/c/crypto49er
  Reply
(07-26-2018, 10:35 PM)crypto49er Wrote: If you just want to switch from SMA to EMA, just go into the strat file and do a find and replace. DEMA works differently so you will have to change the code in the strat a bit to get it to work.

I switched from SMA to EMA. With the same parameters I was using for SMA, it's way worse with EMA in backtesting. I'm running backtests with different candlesizes now and different EMA_long and EMA_short.
  Reply
Hey guys,

Still new to Gekko, been toying with Zenbot before but wanted to try something else out. I just have one issue with RSI_BULL_BEAR_ADX, when I backtest, it quits after like 2 seconds, in the console I see this:

Code:
<-- POST /api/backtest                                                            
  xxx POST /api/backtest 500 634ms -                                                
                                                                                   
  Error: non-error thrown:                                                          
  This Gekko instance encountered an error and can't continue                      
      at Object.onerror (/home/user/gekko/node_modules/koa/lib/context.js:105:40)  
      at <anonymous>                                                                
      at process._tickCallback (internal/process/next_tick.js:188:7)

Am not sure what's wrong. Installed the extra indicators from here: https://github.com/Gab0/gekko-extra-indicators as per first post.

Which I just dropped in /strategies/indicators.

The base RSI_BULL_BEAR works fine though. 

Sorry if this is obvious and stupid, I'm just not too familiar with node.js just yet, but know my way around linux. Gekko is on an ubuntu 16.04 VM with node version 8.11.3

Thanks

EDIT: nevermind, I had mistakenly copied the test indicators from the link above instead of those in the indicators folder. Backtest running fine now!
  Reply


Forum Jump:


Users browsing this thread: