mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
fix order status convert
This commit is contained in:
parent
dcdf33e2c9
commit
c49b9ef276
|
@ -73,13 +73,14 @@ func toGlobalRewards(maxRewards []max.Reward) ([]types.Reward, error) {
|
||||||
func toGlobalOrderStatus(orderState max.OrderState, executedVolume, remainingVolume fixedpoint.Value) types.OrderStatus {
|
func toGlobalOrderStatus(orderState max.OrderState, executedVolume, remainingVolume fixedpoint.Value) types.OrderStatus {
|
||||||
switch orderState {
|
switch orderState {
|
||||||
|
|
||||||
case max.OrderStateFinalizing, max.OrderStateDone, max.OrderStateCancel:
|
case max.OrderStateCancel:
|
||||||
if executedVolume > 0 && remainingVolume > 0 {
|
return types.OrderStatusCanceled
|
||||||
return types.OrderStatusPartiallyFilled
|
|
||||||
|
case max.OrderStateFinalizing, max.OrderStateDone:
|
||||||
|
if executedVolume == 0 {
|
||||||
|
return types.OrderStatusCanceled
|
||||||
} else if remainingVolume == 0 {
|
} else if remainingVolume == 0 {
|
||||||
return types.OrderStatusFilled
|
return types.OrderStatusFilled
|
||||||
} else if executedVolume == 0 {
|
|
||||||
return types.OrderStatusCanceled
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return types.OrderStatusFilled
|
return types.OrderStatusFilled
|
||||||
|
|
Loading…
Reference in New Issue
Block a user