Created
December 11, 2017 11:35
-
-
Save askmike/bc60f3483c09163ded586e1484350b55 to your computer and use it in GitHub Desktop.
custom talib strat debugging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var _ = require('lodash'); | |
var i = 0; | |
var method = { | |
init: function() { | |
console.log(this.settings); | |
this.requiredHistory = this.settings.requiredHistory; | |
this.addTalibIndicator('stochrsi', 'stochrsi', this.settings.stochrsi); | |
this.addTalibIndicator('macd', 'macd', this.settings.macd); | |
this.addTalibIndicator('bbands', 'bbands', this.settings.bbands); | |
}, | |
update: _.noop, | |
log: _.noop, | |
check: function() { | |
if(i === 100) { | |
console.log(this.talibIndicators); | |
throw 'a'; | |
} | |
i++; | |
} | |
}; | |
module.exports = method; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment