run module implemented
This commit is contained in:
1 parent
4f4b80789b
commit
3fd61333a8
1 file changed
+8
-8
@@ -11,10 +11,10 @@ const ROOT_DIR = '../';
|
||||
|
||||
const MODULE_NAME = "run";
|
||||
|
||||
const START_POLONIEX_HOLE_FIXING = true;
|
||||
const START_POLONIEX_HOLE_FIXING_AT_ONE_MONTH = false;
|
||||
const START_ONE_MIN_DAILY_CANDLES = true;
|
||||
const START_ONE_MIN_DAILY_CANDLES_AT_ONE_MONTH = false;
|
||||
|
||||
const POLONIEX_HOLE_FIXING_MODULE = require('./Poloniex Hole Fixing');
|
||||
const ONE_MIN_DAILY_CANDLES_MODULE = require('./One Min Daily Candles');
|
||||
|
||||
const DEBUG_MODULE = require(ROOT_DIR + 'Debug Log');
|
||||
const logger = DEBUG_MODULE.newDebugLog();
|
||||
@@ -37,19 +37,19 @@ process.on('exit', function (code) {
|
||||
|
||||
|
||||
try {
|
||||
if (START_POLONIEX_HOLE_FIXING === true) {
|
||||
if (START_ONE_MIN_DAILY_CANDLES === true) {
|
||||
|
||||
for (let year = 2018; year > 2014; year--) {
|
||||
|
||||
for (let month = 12; month > 0; month--) {
|
||||
|
||||
let timeDelay = Math.random() * 100 * 1000; // We need a delay so as not to get banned from the exchange for requesting to many things at the same time.
|
||||
let timeDelay = Math.random() * 10 * 1000; // We introduce a short delay so as to not overload the machine.
|
||||
|
||||
setTimeout(startProcess, timeDelay);
|
||||
|
||||
function startProcess() {
|
||||
|
||||
const newPloniexHoleFixing = POLONIEX_HOLE_FIXING_MODULE.newPloniexHoleFixing(bot);
|
||||
const newPloniexHoleFixing = ONE_MIN_DAILY_CANDLES_MODULE.newPloniexHoleFixing(bot);
|
||||
|
||||
newPloniexHoleFixing.initialize(year, month, onInitializeReady);
|
||||
|
||||
@@ -68,13 +68,13 @@ try {
|
||||
}
|
||||
|
||||
|
||||
if (START_POLONIEX_HOLE_FIXING_AT_ONE_MONTH === true) {
|
||||
if (START_ONE_MIN_DAILY_CANDLES_AT_ONE_MONTH === true) {
|
||||
|
||||
startProcess();
|
||||
|
||||
function startProcess() {
|
||||
|
||||
const newPloniexHoleFixing = POLONIEX_HOLE_FIXING_MODULE.newPloniexHoleFixing(bot);
|
||||
const newPloniexHoleFixing = ONE_MIN_DAILY_CANDLES_MODULE.newPloniexHoleFixing(bot);
|
||||
|
||||
let month = 2;
|
||||
let year = 2015;
|
||||
|
||||
Reference in new issue
Block a user