mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +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 {
|
||||
switch orderState {
|
||||
|
||||
case max.OrderStateFinalizing, max.OrderStateDone, max.OrderStateCancel:
|
||||
if executedVolume > 0 && remainingVolume > 0 {
|
||||
return types.OrderStatusPartiallyFilled
|
||||
case max.OrderStateCancel:
|
||||
return types.OrderStatusCanceled
|
||||
|
||||
case max.OrderStateFinalizing, max.OrderStateDone:
|
||||
if executedVolume == 0 {
|
||||
return types.OrderStatusCanceled
|
||||
} else if remainingVolume == 0 {
|
||||
return types.OrderStatusFilled
|
||||
} else if executedVolume == 0 {
|
||||
return types.OrderStatusCanceled
|
||||
}
|
||||
|
||||
return types.OrderStatusFilled
|
||||
|
|
Loading…
Reference in New Issue
Block a user