mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
add new sideeffect AUTO_BORROW_REPAY
This commit is contained in:
parent
92ad80f2f8
commit
9a7517a72a
|
@ -39,9 +39,10 @@ var (
|
||||||
type MarginOrderSideEffectType string
|
type MarginOrderSideEffectType string
|
||||||
|
|
||||||
var (
|
var (
|
||||||
SideEffectTypeNoSideEffect MarginOrderSideEffectType = "NO_SIDE_EFFECT"
|
SideEffectTypeNoSideEffect MarginOrderSideEffectType = "NO_SIDE_EFFECT"
|
||||||
SideEffectTypeMarginBuy MarginOrderSideEffectType = "MARGIN_BUY"
|
SideEffectTypeMarginBuy MarginOrderSideEffectType = "MARGIN_BUY"
|
||||||
SideEffectTypeAutoRepay MarginOrderSideEffectType = "AUTO_REPAY"
|
SideEffectTypeAutoRepay MarginOrderSideEffectType = "AUTO_REPAY"
|
||||||
|
SideEffectTypeAutoBorrowRepay MarginOrderSideEffectType = "AUTO_BORROW_REPAY"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (t *MarginOrderSideEffectType) UnmarshalJSON(data []byte) error {
|
func (t *MarginOrderSideEffectType) UnmarshalJSON(data []byte) error {
|
||||||
|
@ -65,6 +66,10 @@ func (t *MarginOrderSideEffectType) UnmarshalJSON(data []byte) error {
|
||||||
*t = SideEffectTypeAutoRepay
|
*t = SideEffectTypeAutoRepay
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
|
case string(SideEffectTypeAutoBorrowRepay), "BORROWREPAY", "AUTOBORROWREPAY":
|
||||||
|
*t = SideEffectTypeAutoBorrowRepay
|
||||||
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return fmt.Errorf("invalid side effect type: %s", data)
|
return fmt.Errorf("invalid side effect type: %s", data)
|
||||||
|
@ -143,7 +148,7 @@ type SubmitOrder struct {
|
||||||
|
|
||||||
GroupID uint32 `json:"groupID,omitempty"`
|
GroupID uint32 `json:"groupID,omitempty"`
|
||||||
|
|
||||||
MarginSideEffect MarginOrderSideEffectType `json:"marginSideEffect,omitempty"` // AUTO_REPAY = repay, MARGIN_BUY = borrow, defaults to NO_SIDE_EFFECT
|
MarginSideEffect MarginOrderSideEffectType `json:"marginSideEffect,omitempty"` // AUTO_BORROW_REPAY = borrowrepay, AUTO_REPAY = repay, MARGIN_BUY = borrow, defaults to NO_SIDE_EFFECT
|
||||||
|
|
||||||
ReduceOnly bool `json:"reduceOnly,omitempty" db:"reduce_only"`
|
ReduceOnly bool `json:"reduceOnly,omitempty" db:"reduce_only"`
|
||||||
ClosePosition bool `json:"closePosition,omitempty" db:"close_position"`
|
ClosePosition bool `json:"closePosition,omitempty" db:"close_position"`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user