From 70a1e08e1444c872324246a12896dbdb216d5dc0 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Wed, 2 May 2018 20:57:24 +0200 Subject: [PATCH] Code simplification --- .vs/AAMariam-Trading-Bot/v15/.suo | Bin 35840 -> 36864 bytes Trading-Process/User.Bot.js | 44 +----------------------------- this.bot.config.json | 2 +- 3 files changed, 2 insertions(+), 44 deletions(-) diff --git a/.vs/AAMariam-Trading-Bot/v15/.suo b/.vs/AAMariam-Trading-Bot/v15/.suo index ad39587d6637cd320c4f379a7750323184536792..9b96c20a5b28b2d497275f1bae3e8f38f32c0a4d 100644 GIT binary patch delta 352 zcmZpe!PKyTX@Y?)69W_oFfecdnIQhZ|NsAkM42Z~)CDGvA^P766=SYD)kB delta 328 zcmZozz|=5rumooV?a_|C`X#nx$3*{=44VYLae_>bfAORE;1!4yv7TBD~@rZ?!5#%;zAck4Axr8@_b@K@cE5^x8B2FA2 ztstWi(k4BOi^SL#$uTX`V%ns1gptDpWE!%PFOED+i^P~F={R#Tg7nKEOP1&W^=q(9 lQgfbsnB8!5iCYizCWE businessLogic -> Entering function."); } - - let positions = assistant.getPositions(); - - if (positions.length > 0) { - - decideWhatToDo(callBack); - - } else { - - let rate = assistant.getMarketRate(); - rate = Number(rate.toFixed(8)); - - const INITIAL_BALANCE_A = 0.000; - const INITIAL_BALANCE_B = 0.001; - - let amountA = INITIAL_BALANCE_A; - let amountB = INITIAL_BALANCE_B; - - amountB = Number(amountB.toFixed(8)); - - amountA = amountB * rate; - amountA = Number(amountA.toFixed(8)); - - assistant.putPosition("sell", rate, amountA, amountB, callBack); - - if (LOG_INFO === true) { logger.write("[INFO] start -> businessLogic -> We start placing the first SELL order."); } - if (LOG_INFO === true) { logger.write("[INFO] start -> businessLogic -> amountA = " + amountA); } - if (LOG_INFO === true) { logger.write("[INFO] start -> businessLogic -> amountB = " + amountB); } - if (LOG_INFO === true) { logger.write("[INFO] start -> businessLogic -> rate = " + rate); } - - } - } catch (err) { - logger.write("[ERROR] start -> businessLogic -> err = " + err.message); - callBack(global.DEFAULT_FAIL_RESPONSE); - } - } - function decideWhatToDo(callBack) { try { @@ -154,7 +112,7 @@ return; } - if (Math.random() * 10 > 5) { + if (Math.random() * 10 > 8) { if (LOG_INFO === true) { logger.write("[INFO] start -> decideWhatToDo -> In some situations it is just fin no to place orders. Passing this turn. "); } callBack(global.DEFAULT_OK_RESPONSE); diff --git a/this.bot.config.json b/this.bot.config.json index 4dd8dffce..6f99a8bb6 100644 --- a/this.bot.config.json +++ b/this.bot.config.json @@ -17,7 +17,7 @@ "startMode": { "live": { "run": "true", - "resumeExecution": "false" + "resumeExecution": "true" }, "backtest": { "run": "false",