mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
disable marketTrade stop
This commit is contained in:
parent
2d0fbe4b99
commit
6e4c28ed1b
|
@ -9,6 +9,8 @@ import (
|
|||
"github.com/c9s/bbgo/pkg/types"
|
||||
)
|
||||
|
||||
const enableMarketTradeStop = false
|
||||
|
||||
type ProtectiveStopLoss struct {
|
||||
Symbol string `json:"symbol"`
|
||||
|
||||
|
@ -122,7 +124,7 @@ func (s *ProtectiveStopLoss) Bind(session *ExchangeSession, orderExecutor *Gener
|
|||
}
|
||||
})
|
||||
|
||||
if !IsBackTesting {
|
||||
if !IsBackTesting && enableMarketTradeStop {
|
||||
session.MarketDataStream.OnMarketTrade(func(trade types.Trade) {
|
||||
if trade.Symbol != position.Symbol {
|
||||
return
|
||||
|
|
|
@ -29,7 +29,7 @@ func (s *RoiStopLoss) Bind(session *ExchangeSession, orderExecutor *GeneralOrder
|
|||
s.checkStopPrice(kline.Close, position)
|
||||
}))
|
||||
|
||||
if !IsBackTesting {
|
||||
if !IsBackTesting && enableMarketTradeStop {
|
||||
session.MarketDataStream.OnMarketTrade(func(trade types.Trade) {
|
||||
if trade.Symbol != position.Symbol {
|
||||
return
|
||||
|
|
|
@ -58,7 +58,7 @@ func (s *TrailingStop2) Bind(session *ExchangeSession, orderExecutor *GeneralOrd
|
|||
}
|
||||
}))
|
||||
|
||||
if !IsBackTesting {
|
||||
if !IsBackTesting && enableMarketTradeStop {
|
||||
session.MarketDataStream.OnMarketTrade(func(trade types.Trade) {
|
||||
if trade.Symbol != position.Symbol {
|
||||
return
|
||||
|
|
|
@ -220,13 +220,6 @@ func (s *BreakLow) Bind(session *bbgo.ExchangeSession, orderExecutor *bbgo.Gener
|
|||
})
|
||||
}
|
||||
}))
|
||||
|
||||
if !bbgo.IsBackTesting {
|
||||
// use market trade to submit short order
|
||||
session.MarketDataStream.OnMarketTrade(func(trade types.Trade) {
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func useQuantityOrBaseBalance(session *bbgo.ExchangeSession, market types.Market, price, quantity, leverage fixedpoint.Value) (fixedpoint.Value, error) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user