Explorar el Código

修复数量和价格的计算问题

龚成明 hace 2 años
padre
commit
b181830f48
Se han modificado 1 ficheros con 2 adiciones y 3 borrados
  1. 2 3
      scripts/one-pro.js

+ 2 - 3
scripts/one-pro.js

@@ -96,10 +96,9 @@ const orderHandler = async function(context, task) {
             executedQty -= parseFloat(fill.commission)
           }
         }
-        executedQty = NumKit.getSubFloat(executedQty, token.exchange.lotSize)
 
-        token.orderAmount = executedQty
-        token.orderPrice = cummulativeQuoteQty / executedQty
+        token.orderAmount = NumKit.getSubFloat(executedQty, token.exchange.lotSize)
+        token.orderPrice = NumKit.getSubFloat(cummulativeQuoteQty / executedQty, token.exchange.tickSize)
 
         fileLogger.info(`[单]${pair}, volume:${cummulativeQuoteQty}, 买入${executedQty}, 均价${token.orderPrice}.`)