mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-25 00:05:15 +00:00
xmaker: add SubscribeFeeTokenMarkets option
This commit is contained in:
parent
969e813c7f
commit
2599a4bcd3
|
@ -88,6 +88,8 @@ type Strategy struct {
|
|||
HedgeInterval types.Duration `json:"hedgeInterval"`
|
||||
OrderCancelWaitTime types.Duration `json:"orderCancelWaitTime"`
|
||||
|
||||
SubscribeFeeTokenMarkets bool `json:"subscribeFeeTokenMarkets"`
|
||||
|
||||
EnableSignalMargin bool `json:"enableSignalMargin"`
|
||||
SignalConfigList []SignalConfig `json:"signals"`
|
||||
SignalMarginScale *bbgo.SlideRule `json:"signalMarginScale,omitempty"`
|
||||
|
@ -232,6 +234,13 @@ func (s *Strategy) CrossSubscribe(sessions map[string]*bbgo.ExchangeSession) {
|
|||
sourceSession.Subscribe(types.KLineChannel, s.Symbol, types.SubscribeOptions{Interval: sig.BollingerBandTrendSignal.Interval})
|
||||
}
|
||||
}
|
||||
|
||||
if s.SubscribeFeeTokenMarkets {
|
||||
feeTokenQuote := "USDT"
|
||||
subscribeOpts := types.SubscribeOptions{Interval: "1m"}
|
||||
sourceSession.Subscribe(types.KLineChannel, sourceSession.Exchange.PlatformFeeCurrency()+feeTokenQuote, subscribeOpts)
|
||||
makerSession.Subscribe(types.KLineChannel, makerSession.Exchange.PlatformFeeCurrency()+feeTokenQuote, subscribeOpts)
|
||||
}
|
||||
}
|
||||
|
||||
func aggregatePrice(pvs types.PriceVolumeSlice, requiredQuantity fixedpoint.Value) (price fixedpoint.Value) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user