07-03-2018, 08:22 PM
(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 - - - -
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 - - - -