From c0ae66361b8c67d8c037d4288ef817a3dce70bc3 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Tue, 20 Aug 2019 11:08:33 +0200 Subject: [PATCH] Refactoring --- Context.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Context.js b/Context.js index dc365ec50..23f09ab5c 100644 --- a/Context.js +++ b/Context.js @@ -304,24 +304,24 @@ thisObject.executionHistory = []; - if (process.env.INITIAL_BALANCE_ASSET_A === undefined || process.env.INITIAL_BALANCE_ASSET_B === undefined) { throw new Error("Environment Variables INITIAL_INVESTMENT_A and INITIAL_INVESTMENT_B cannot be undefined.") } + if (process.env.INITIAL_BALANCE_ASSET_A === undefined || process.env.INITIAL_BALANCE_ASSET_B === undefined) { throw new Error("Environment Variables INITIAL_BALANCE_A and INITIAL_BALANCE_B cannot be undefined.") } - const INITIAL_INVESTMENT_A = Number(process.env.INITIAL_BALANCE_ASSET_A); - const INITIAL_INVESTMENT_B = Number(process.env.INITIAL_BALANCE_ASSET_B); + const INITIAL_BALANCE_A = Number(process.env.INITIAL_BALANCE_ASSET_A); + const INITIAL_BALANCE_B = Number(process.env.INITIAL_BALANCE_ASSET_B); thisObject.executionContext = { investment: { // This is used to calculate profits. - assetA: INITIAL_INVESTMENT_A, - assetB: INITIAL_INVESTMENT_B + assetA: INITIAL_BALANCE_A, + assetB: INITIAL_BALANCE_B }, balance: { // This is the total balance that includes positions at the order book + funds available to be traded. - assetA: INITIAL_INVESTMENT_A, - assetB: INITIAL_INVESTMENT_B // It starts with the initial investment. + assetA: INITIAL_BALANCE_A, + assetB: INITIAL_BALANCE_B // It starts with the initial investment. }, availableBalance: { // This is the balance the bot has at any moment in time available to be traded (not in positions at the order book). - assetA: INITIAL_INVESTMENT_A, - assetB: INITIAL_INVESTMENT_B // It starts with the initial investment. + assetA: INITIAL_BALANCE_A, + assetB: INITIAL_BALANCE_B // It starts with the initial investment. }, profits: { assetA: 0,