[SHARE] Simple RSI BULL/BEAR strategy
(06-14-2018, 01:16 PM)dugu-dugu Wrote: How can I debug my strategy, that is, display the current values of indicators in logs? I'm running gekko with pm2.

Something like:
Datetime: RSI Bull=current value, RSI bear=current value, ADX=current value

It's still pretty opaque for me how this works, I need to understand more of what's going on.

I've added debug code, the result looks like this (using pm2 to start gekko in command line):
Code:
2018-07-01 18:14:19 (INFO):     - - - Begin check function - - - [/color]
2018-07-01 18:14:19 (INFO):     maSlow: 108.84379032258067 maFast: 111.06619047619064 ADX: 84.74747968645497
2018-07-01 18:14:19 (INFO):     Bull maFast: 111.06619047619064 > maSlow: 108.84379032258067
2018-07-01 18:14:19 (INFO):     Bull RSI: 32.53955349896498 bull high: 85 bull low: 40
2018-07-01 18:14:19 (INFO):     ADX: 84.74747968645497 > ADX_high 83
2018-07-01 18:14:19 (INFO):     RSI bull high: 85 + bull mod_high 5
2018-07-01 18:14:19 (INFO):     RSI bull high new value: 90
2018-07-01 18:14:19 (INFO):     RSI: 32.53955349896498 < RSI bull low: 40 calling long function
2018-07-01 18:14:19 (INFO):     Long since 2 candle(s)
2018-07-01 18:14:19 (INFO):     - - - End check function - - - -
2018-07-01 18:34:19 (INFO):     - - - Begin check function - - -
2018-07-01 18:34:19 (INFO):     maSlow: 108.82608870967745 maFast: 110.97666666666683 ADX: 89.37383363508624
2018-07-01 18:34:19 (INFO):     Bull maFast: 110.97666666666683 > maSlow: 108.82608870967745
2018-07-01 18:34:19 (INFO):     Bull RSI: 29.457775673216034 bull high: 85 bull low: 40
2018-07-01 18:34:19 (INFO):     ADX: 89.37383363508624 > ADX_high 83
2018-07-01 18:34:19 (INFO):     RSI bull high: 85 + bull mod_high 5
2018-07-01 18:34:19 (INFO):     RSI bull high new value: 90
2018-07-01 18:34:19 (INFO):     RSI: 29.457775673216034 < RSI bull low: 40 calling long function
2018-07-01 18:34:19 (INFO):     Long since 3 candle(s)
2018-07-01 18:34:19 (INFO):     - - - End check function - - - -
I don't understand why it sometimes runs the check function more than once in the same second, like in this example:
Code:
2018-07-01 17:37:00 (INFO):     - - - Begin check function - - - [/color]
2018-07-01 17:37:00 (INFO):     maSlow: 108.89625000000002 maFast: 111.34714285714303 ADX: 62.46388807339842
2018-07-01 17:37:00 (INFO):     Bull maFast: 111.34714285714303 > maSlow: 108.89625000000002
2018-07-01 17:37:00 (INFO):     Bull RSI: 44.71872438361014 bull high: 85 bull low: 40
2018-07-01 17:37:00 (INFO):     - - - End check function - - - -
2018-07-01 17:37:00 (INFO):     - - - Begin check function - - -
2018-07-01 17:37:00 (INFO):     maSlow: 108.88548387096776 maFast: 111.28809523809542 ADX: 66.23024929556257
2018-07-01 17:37:00 (INFO):     Bull maFast: 111.28809523809542 > maSlow: 108.88548387096776
2018-07-01 17:37:00 (INFO):     Bull RSI: 44.71872438361014 bull high: 85 bull low: 40
2018-07-01 17:37:00 (INFO):     - - - End check function - - - -
2018-07-01 17:37:00 (INFO):     - - - Begin check function - - -
2018-07-01 17:37:00 (INFO):     maSlow: 108.87471774193551 maFast: 111.25190476190494 ADX: 68.74115677700533
2018-07-01 17:37:00 (INFO):     Bull maFast: 111.25190476190494 > maSlow: 108.87471774193551
2018-07-01 17:37:00 (INFO):     Bull RSI: 44.71872438361014 bull high: 85 bull low: 40
2018-07-01 17:37:00 (INFO):     - - - End check function - - - -
If anyone cares about the debug code, I will post it. It makes the strategy more difficult to follow, but it helps to understand how it works with real data, real time.
  Reply


Messages In This Thread
Werkkrew Stoploss - by susitronix - 02-02-2018, 09:39 PM
Removed post - by susitronix - 02-03-2018, 06:49 PM
@Gryphon Confirmation - by mvangoor - 03-22-2019, 11:59 PM
for 3 months - by ankasem - 02-18-2018, 05:30 PM
RE: [SHARE] Simple RSI BULL/BEAR strategy - by dugu-dugu - 07-03-2018, 08:22 PM

Forum Jump:


Users browsing this thread: