mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 16:25:16 +00:00
pivotshort: log submit order error
This commit is contained in:
parent
edc8c132d5
commit
90f3727d68
|
@ -220,8 +220,8 @@ func (s *FailedBreakHigh) Bind(session *bbgo.ExchangeSession, orderExecutor *bbg
|
||||||
}
|
}
|
||||||
|
|
||||||
if s.MarketOrder {
|
if s.MarketOrder {
|
||||||
bbgo.Notify("%s price %f failed breaking the previous high %f with ratio %f, submitting market sell to open a short position", symbol, kline.Close.Float64(), previousHigh.Float64(), s.Ratio.Float64())
|
bbgo.Notify("%s price %f failed breaking the previous high %f with ratio %f, submitting market sell %f to open a short position", symbol, kline.Close.Float64(), previousHigh.Float64(), s.Ratio.Float64(), quantity.Float64())
|
||||||
_, _ = s.orderExecutor.SubmitOrders(ctx, types.SubmitOrder{
|
_, err := s.orderExecutor.SubmitOrders(ctx, types.SubmitOrder{
|
||||||
Symbol: s.Symbol,
|
Symbol: s.Symbol,
|
||||||
Side: types.SideTypeSell,
|
Side: types.SideTypeSell,
|
||||||
Type: types.OrderTypeMarket,
|
Type: types.OrderTypeMarket,
|
||||||
|
@ -229,12 +229,15 @@ func (s *FailedBreakHigh) Bind(session *bbgo.ExchangeSession, orderExecutor *bbg
|
||||||
MarginSideEffect: types.SideEffectTypeMarginBuy,
|
MarginSideEffect: types.SideEffectTypeMarginBuy,
|
||||||
Tag: "FailedBreakHighMarket",
|
Tag: "FailedBreakHighMarket",
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
|
bbgo.Notify(err.Error())
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
sellPrice := previousHigh
|
sellPrice := previousHigh
|
||||||
|
|
||||||
bbgo.Notify("%s price %f failed breaking the previous high %f with ratio %f, submitting limit sell @ %f", symbol, kline.Close.Float64(), previousHigh.Float64(), s.Ratio.Float64(), sellPrice.Float64())
|
bbgo.Notify("%s price %f failed breaking the previous high %f with ratio %f, submitting limit sell @ %f", symbol, kline.Close.Float64(), previousHigh.Float64(), s.Ratio.Float64(), sellPrice.Float64())
|
||||||
_, _ = s.orderExecutor.SubmitOrders(ctx, types.SubmitOrder{
|
_, err := s.orderExecutor.SubmitOrders(ctx, types.SubmitOrder{
|
||||||
Symbol: kline.Symbol,
|
Symbol: kline.Symbol,
|
||||||
Side: types.SideTypeSell,
|
Side: types.SideTypeSell,
|
||||||
Type: types.OrderTypeLimit,
|
Type: types.OrderTypeLimit,
|
||||||
|
@ -243,6 +246,10 @@ func (s *FailedBreakHigh) Bind(session *bbgo.ExchangeSession, orderExecutor *bbg
|
||||||
MarginSideEffect: types.SideEffectTypeMarginBuy,
|
MarginSideEffect: types.SideEffectTypeMarginBuy,
|
||||||
Tag: "FailedBreakHighLimit",
|
Tag: "FailedBreakHighLimit",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
bbgo.Notify(err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user