mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
riskcontrol: log on release position order
This commit is contained in:
parent
d6ade1f2fd
commit
baf431d7b6
|
@ -36,14 +36,16 @@ func NewPositionRiskControl(orderExecutor bbgo.OrderExecutorExtended, hardLimit,
|
||||||
|
|
||||||
control.OnReleasePosition(func(quantity fixedpoint.Value, side types.SideType) {
|
control.OnReleasePosition(func(quantity fixedpoint.Value, side types.SideType) {
|
||||||
pos := orderExecutor.Position()
|
pos := orderExecutor.Position()
|
||||||
createdOrders, err := orderExecutor.SubmitOrders(context.Background(), types.SubmitOrder{
|
submitOrder := types.SubmitOrder{
|
||||||
Symbol: pos.Symbol,
|
Symbol: pos.Symbol,
|
||||||
Market: pos.Market,
|
Market: pos.Market,
|
||||||
Side: side,
|
Side: side,
|
||||||
Type: types.OrderTypeMarket,
|
Type: types.OrderTypeMarket,
|
||||||
Quantity: quantity,
|
Quantity: quantity,
|
||||||
})
|
}
|
||||||
|
|
||||||
|
log.Infof("submitting order: %+v", submitOrder)
|
||||||
|
createdOrders, err := orderExecutor.SubmitOrders(context.Background(), submitOrder)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.WithError(err).Errorf("failed to submit orders")
|
log.WithError(err).Errorf("failed to submit orders")
|
||||||
return
|
return
|
||||||
|
|
Loading…
Reference in New Issue
Block a user