소스 검색

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

龚成明 2 년 전
부모
커밋
b181830f48
1개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  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}.`)