first commit
This commit is contained in:
commit
aa7869eb33
386 files changed
+69375
No files matched your search
@@ -0,0 +1,30 @@
|
||||
var method = {};
|
||||
// Prepare everything our method needs
|
||||
method.init = function() {
|
||||
this.name = 'tulip-adx'
|
||||
this.trend = 'none';
|
||||
this.requiredHistory = this.tradingAdvisor.historySize;
|
||||
this.addTulipIndicator('myadx', 'adx', this.settings);
|
||||
}
|
||||
// What happens on every new candle?
|
||||
method.update = function(candle) {
|
||||
// nothing!
|
||||
}
|
||||
method.log = function() {
|
||||
// nothing!
|
||||
}
|
||||
method.check = function(candle) {
|
||||
var price = candle.close;
|
||||
var adx = this.tulipIndicators.myadx.result.result;
|
||||
// console.dir(adx)
|
||||
|
||||
if(this.settings.thresholds.down > adx && this.trend !== 'short') {
|
||||
this.trend = 'short';
|
||||
this.advice('short');
|
||||
} else if(this.settings.thresholds.up < adx && this.trend !== 'long'){
|
||||
this.trend = 'long';
|
||||
this.advice('long');
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = method;
|
||||
Reference in new issue
Block a user