Commit 6e81711e by rongjun

bug

parent 434b44e2
......@@ -84,12 +84,13 @@ class BiboxStrategy3 extends Strategy3 {
if (order.executedQty === order.origQty) {
console.log("买入全部成交");
createdBuyOrder = true;
amount = collector.processAmount(midCurrency, baseCurrency2, parseFloat(order.executedQty*0.999));
sellOrder();
returnOrder();
} else if (parseFloat(order.executedQty) > 0) {
returnAmount = parseFloat(returnAmount) * parseFloat(order.executedQty) / parseFloat(amount);
returnAmount = collector.processAmount(baseCurrency2, baseCurrency1, returnAmount);
amount = collector.processAmount(midCurrency, baseCurrency2, parseFloat(order.executedQty));
amount = collector.processAmount(midCurrency, baseCurrency2, parseFloat(order.executedQty*0.999));
console.log(`买入部分成交${order.executedQty} 回归量调整为${returnAmount}`);
order.remark = "部分成交@amount " + order.executedQty + ";";
createdBuyOrder = true;
......
......@@ -22,18 +22,15 @@ function returnFakeOrder(symbol, price, amount) {
function convertToRecordOrder(order) {
let status = constants.OrderStatusNew;
if(!order.isActive){
status = constants.OrderStatusCanceled;
if(order.pendingAmount === 0){
status = constants.OrderStatusFilled;
}else{
if(order.pendingAmount === 0){
status = constants.OrderStatusFilled;
}
// if(order.dealAmount === 0){
// status = constants.OrderStatusNew;
// }
if(order.dealAmount > 0 && order.pendingAmount >0){
if(order.dealAmount > 0){
status = constants.OrderStatusPartiallyFilled;
}
if(!order.isActive && order.dealAmount === 0){
status = constants.OrderStatusCanceled;
}
}
return {
orderId: order.orderOid + '',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment