mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
add DisableMarketDataStore option
This commit is contained in:
parent
7f8a331373
commit
8878005417
|
@ -335,7 +335,10 @@ type EnvironmentConfig struct {
|
||||||
DisableStartupBalanceQuery bool `json:"disableStartupBalanceQuery"`
|
DisableStartupBalanceQuery bool `json:"disableStartupBalanceQuery"`
|
||||||
|
|
||||||
DisableSessionTradeBuffer bool `json:"disableSessionTradeBuffer"`
|
DisableSessionTradeBuffer bool `json:"disableSessionTradeBuffer"`
|
||||||
MaxSessionTradeBufferSize int `json:"maxSessionTradeBufferSize"`
|
|
||||||
|
DisableMarketDataStore bool `json:"disableMarketDataStore"`
|
||||||
|
|
||||||
|
MaxSessionTradeBufferSize int `json:"maxSessionTradeBufferSize"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
|
|
|
@ -405,6 +405,7 @@ func (session *ExchangeSession) initSymbol(ctx context.Context, environ *Environ
|
||||||
return fmt.Errorf("market %s is not defined", symbol)
|
return fmt.Errorf("market %s is not defined", symbol)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
disableMarketDataStore := environ.environmentConfig != nil && environ.environmentConfig.DisableMarketDataStore
|
||||||
disableSessionTradeBuffer := environ.environmentConfig != nil && environ.environmentConfig.DisableSessionTradeBuffer
|
disableSessionTradeBuffer := environ.environmentConfig != nil && environ.environmentConfig.DisableSessionTradeBuffer
|
||||||
maxSessionTradeBufferSize := 0
|
maxSessionTradeBufferSize := 0
|
||||||
if environ.environmentConfig != nil && environ.environmentConfig.MaxSessionTradeBufferSize > 0 {
|
if environ.environmentConfig != nil && environ.environmentConfig.MaxSessionTradeBufferSize > 0 {
|
||||||
|
@ -441,13 +442,13 @@ func (session *ExchangeSession) initSymbol(ctx context.Context, environ *Environ
|
||||||
orderStore.BindStream(session.UserDataStream)
|
orderStore.BindStream(session.UserDataStream)
|
||||||
session.orderStores[symbol] = orderStore
|
session.orderStores[symbol] = orderStore
|
||||||
|
|
||||||
if _, ok := session.marketDataStores[symbol]; !ok {
|
marketDataStore := NewMarketDataStore(symbol)
|
||||||
marketDataStore := NewMarketDataStore(symbol)
|
if !disableMarketDataStore {
|
||||||
marketDataStore.BindStream(session.MarketDataStream)
|
if _, ok := session.marketDataStores[symbol]; !ok {
|
||||||
session.marketDataStores[symbol] = marketDataStore
|
marketDataStore.BindStream(session.MarketDataStream)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
session.marketDataStores[symbol] = marketDataStore
|
||||||
marketDataStore := session.marketDataStores[symbol]
|
|
||||||
|
|
||||||
if _, ok := session.standardIndicatorSets[symbol]; !ok {
|
if _, ok := session.standardIndicatorSets[symbol]; !ok {
|
||||||
standardIndicatorSet := NewStandardIndicatorSet(symbol, session.MarketDataStream, marketDataStore)
|
standardIndicatorSet := NewStandardIndicatorSet(symbol, session.MarketDataStream, marketDataStore)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user