diff --git a/.vs/AACloud/v15/.suo b/.vs/AACloud/v15/.suo index c975857f2..6f4c3310a 100644 Binary files a/.vs/AACloud/v15/.suo and b/.vs/AACloud/v15/.suo differ diff --git a/Assistant.js b/Assistant.js index 85c0fdf3a..b0fe31b30 100644 --- a/Assistant.js +++ b/Assistant.js @@ -88,6 +88,13 @@ let candleArray; + if (err.result === global.CUSTOM_FAIL_RESPONSE.result) { // Just past midnight, this file will not exist for a couple of minutes. + if (err.message === "File does not exist.") { + callBackFunction(global.DEFAULT_RETRY_RESPONSE); + return; + } + } + if (err.result === global.DEFAULT_OK_RESPONSE.result) { try { candleArray = JSON.parse(text); @@ -689,8 +696,8 @@ /* To this we add the current position amounts. */ - sumAssetA = sumAssetA + exchangePosition.amountA; - sumAssetB = sumAssetB + exchangePosition.amountB; + sumAssetA = sumAssetA + Number(exchangePosition.amountA.toFixed(8)); + sumAssetB = sumAssetB + Number(exchangePosition.amountB.toFixed(8)); sumAssetA = Number(sumAssetA.toFixed(8)); sumAssetB = Number(sumAssetB.toFixed(8)); @@ -1026,12 +1033,14 @@ if (position.type === 'buy') { context.executionContext.availableBalance.assetA = context.executionContext.availableBalance.assetA - pAmountA; + context.executionContext.availableBalance.assetA = Number(context.executionContext.availableBalance.assetA.toFixed(8)); context.newHistoryRecord.lastBuyRate = pRate; } if (position.type === 'sell') { context.executionContext.availableBalance.assetB = context.executionContext.availableBalance.assetB - pAmountB; + context.executionContext.availableBalance.assetB = Number(context.executionContext.availableBalance.assetB.toFixed(8)); context.newHistoryRecord.lastSellRate = pRate; } diff --git a/Debug Log.js b/Debug Log.js index 310eb97df..aaeed4732 100644 --- a/Debug Log.js +++ b/Debug Log.js @@ -167,9 +167,9 @@ } catch (err) { - console.log("Error trying to log info into a file."); - console.log("File: " + filePath ); - console.log("Error: " + err.message); + //console.log("Error trying to log info into a file."); + //console.log("File: " + filePath ); + //console.log("Error: " + err.message); } } @@ -270,7 +270,7 @@ } } catch (err) { - console.log("Error trying to delete Loop Folder " + pFolderPath + ".Reading file " + fileName + ". err.message = " + err.message); + //console.log("Error trying to delete Loop Folder " + pFolderPath + ".Reading file " + fileName + ". err.message = " + err.message); } } })