Closed magicdude4eva closed 6 years ago
Hey, Could you provide the following:
Config for strategy:
let candleFactor = 1;
config.tradingAdvisor = {
enabled: true,
method: 'magicdudecrypto',
candleSize: 3,
historySize: 25 * candleFactor,
adapter: 'sqlite'
}
// ======================================================================
// BBands:
// MATType: SMA = 0, EMA = 1, WMA = 2, DEMA = 3, TEMA = 4, TRIMA = 5, KAMA = 6, MAMA = 7, T3 = 8
config.magicdudecrypto = {
minTrendDuration: 3,
stochrsi: {
optInTimePeriod: 14 * candleFactor,
optInFastK_Period: 5 * candleFactor,
optInFastD_Period: 5 * candleFactor,
optInFastD_MAType: 0
},
macd: {
optInFastPeriod: 6 * candleFactor,
optInSlowPeriod: 12 * candleFactor,
optInSignalPeriod: 5 * candleFactor
},
bbands: {
optInTimePeriod: 20 * candleFactor,
optInNbDevUp: 2,
optInNbDevDn: 2,
optInMAType: 0
},
requiredHistory: config.tradingAdvisor.historySize
}
Strat-init:
strat.init = function() {
this.name = 'MD4E-Bot';
this.input = 'candle';
this.requiredHistory = this.settings.requiredHistory;
<SNIP>
this.addTalibIndicator('stochrsi', 'stochrsi', this.settings.stochrsi);
this.addTalibIndicator('macd', 'macd', this.settings.macd);
this.addTalibIndicator('bbands', 'bbands', this.settings.bbands);
}
Strat update:
// What happens on every new candle?
strat.update = function(candle) {
let macd = this.talibIndicators.macd;
let stochrsi = this.talibIndicators.stochrsi;
let bbands = this.talibIndicators.bbands;
log.info('MACD=', macd);
log.info('stochrsi=', stochrsi);
log.info('bbands=', bbands);
<SNIP>
}
Very strange, for me it's working fine..
Here is the config snippet and the complete strat I tested: https://gist.github.com/askmike/bc60f3483c09163ded586e1484350b55
It outputs:
{ stochrsi:
{ run: [Function],
result: { outFastK: 6.355306266244574, outFastD: 1.2710612532489347 } },
macd:
{ run: [Function],
result:
{ outMACD: -0.15695440522040371,
outMACDSignal: -0.013204418703371787,
outMACDHist: -0.1437499865170319 } },
bbands:
{ run: [Function],
result:
{ outRealUpperBand: 1020.5776305104915,
outRealMiddleBand: 1019.2174999999995,
outRealLowerBand: 1017.8573694895075 } } }
/Users/pear/projects/gekko/strategies/magicdudecrypto.js:21
throw 'a';
Can you check whether my gist works for you?
@askmike thanks I will check later - Bitfinex is giving me trouble and I don't get enough data. Just to confirm when I test tonight: Is there a possibility that perhaps Bitfinex is the issue (i.e. that the indicators don't read the details).
Can you also confirm the coin-pair you tested against? Also - how did you manage to test this so quick. I started the above config around 4:30pm, and now at 8:20pm it is only through loop 57 out of 100).
I can confirm that your Gist worked. Let me re-run my strategy tomorrow
2017-12-11 22:36:15 (DEBUG): Processing 47 new trades. From 2017-12-11 20:29:49 UTC to 2017-12-11 20:30:06 UTC. (a few seconds)
{ stochrsi:
{ run: [Function],
result: { outFastK: 39.858578010765854, outFastD: 76.88968905335278 } },
macd:
{ run: [Function],
result:
{ outMACD: -0.0033713326892392814,
outMACDSignal: -0.007245580267472204,
outMACDHist: 0.0038742475782329224 } },
bbands:
{ run: [Function],
result:
{ outRealUpperBand: 4.3855918543191805,
outRealMiddleBand: 4.2969599999999994,
outRealLowerBand: 4.208328145680818 } } }
Sorry for all the hassles. I was just too impatient. Having the strategy run for at least 2 hours will produce results.
Note: for support questions, please join our Discord server
I'm submitting a ... [X] bug report [ ] feature request [ ] question about the decisions made in the repository
Action taken (what you did) Running node v8.9.3 on OSX 10.13.2 with talib@1.0.2 on Gekko build v0.5.11.
Wrote a own strategy which initialises a number of talib indicators:
Expected result (what you hoped would happen) I expected that the indicators return values, but only every produce NaN.
Actual result (unexpected outcome) gekko-debug.txt
Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, etc)