This repository has been archived on 2025-10-29. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
gekko/strategies/DEBUG_single-advice.js
T
2021-06-06 20:25:14 +02:00

37 lines
554 B
JavaScript

var settings = {
wait: 0,
// advice: 'short'
advice: 'long'
};
// -------
var _ = require('lodash');
var log = require('../core/log.js');
var i = 0;
var method = {
init: _.noop,
update: _.noop,
log: _.noop,
check: function() {
// log.info('iteration:', i);
if(settings.wait === i) {
console.log('trigger advice!');
this.advice({
direction: settings.advice,
trigger: {
type: 'trailingStop',
trailPercentage: 0.5
}
});
}
i++
}
};
module.exports = method;