diff --git a/Assistant.js b/Assistant.js index 29abde15d..b52db201f 100644 --- a/Assistant.js +++ b/Assistant.js @@ -711,10 +711,10 @@ sumAssetA = sumAssetA + Number(exchangePosition.amountA); sumAssetB = sumAssetB + Number(exchangePosition.amountB); - sumAssetA = Number(sumAssetA.toFixed(8)); - sumAssetB = Number(sumAssetB.toFixed(8)); + sumAssetA = Number(sumAssetA.toFixed(5)); + sumAssetB = Number(sumAssetB.toFixed(5)); - if (position.amountA !== sumAssetA || position.amountB !== sumAssetB ) { + if (position.amountA.toFixed(5) !== sumAssetA || position.amountB.toFixed(5) !== sumAssetB) { logger.write(MODULE_NAME, "[ERROR] ordersExecutionCheck -> loopBody -> confirmOrderWasPartiallyExecuted -> position.amountA = " + position.amountA); logger.write(MODULE_NAME, "[ERROR] ordersExecutionCheck -> loopBody -> confirmOrderWasPartiallyExecuted -> sumAssetA = " + sumAssetA); logger.write(MODULE_NAME, "[ERROR] ordersExecutionCheck -> loopBody -> confirmOrderWasPartiallyExecuted -> position.amountB = " + position.amountB); diff --git a/ExchangeAPI.js b/ExchangeAPI.js index 11a23d153..ad6a5512e 100644 --- a/ExchangeAPI.js +++ b/ExchangeAPI.js @@ -263,7 +263,7 @@ if (pPosition.type === "buy") { newAmount = pPosition.amountA / pNewRate; } else { - newAmount = pPosition.amountB * pNewRate; + newAmount = pPosition.amountB; } if (global.LOG_CONTROL[MODULE_NAME].logInfo === true) { logger.write(MODULE_NAME, "[INFO] movePosition -> newAmount = " + newAmount); }