mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
fix: comment format, dbg logs in session
This commit is contained in:
parent
d247e1cb97
commit
3d672ea518
|
@ -422,7 +422,6 @@ func (session *ExchangeSession) initSymbol(ctx context.Context, environ *Environ
|
||||||
|
|
||||||
// always subscribe the 1m kline so we can make sure the connection persists.
|
// always subscribe the 1m kline so we can make sure the connection persists.
|
||||||
klineSubscriptions[minInterval] = struct{}{}
|
klineSubscriptions[minInterval] = struct{}{}
|
||||||
log.Warnf("sub: %v", klineSubscriptions)
|
|
||||||
|
|
||||||
for interval := range klineSubscriptions {
|
for interval := range klineSubscriptions {
|
||||||
// avoid querying the last unclosed kline
|
// avoid querying the last unclosed kline
|
||||||
|
@ -451,8 +450,6 @@ func (session *ExchangeSession) initSymbol(ctx context.Context, environ *Environ
|
||||||
session.lastPrices[symbol] = lastKLine.Close
|
session.lastPrices[symbol] = lastKLine.Close
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Warnf("load %s", interval)
|
|
||||||
|
|
||||||
for _, k := range kLines {
|
for _, k := range kLines {
|
||||||
// let market data store trigger the update, so that the indicator could be updated too.
|
// let market data store trigger the update, so that the indicator could be updated too.
|
||||||
marketDataStore.AddKLine(k)
|
marketDataStore.AddKLine(k)
|
||||||
|
|
|
@ -25,7 +25,8 @@ func (i Interval) Seconds() int {
|
||||||
return m
|
return m
|
||||||
}
|
}
|
||||||
|
|
||||||
// specially handled, for better precision
|
// Milliseconds is specially handled, for better precision
|
||||||
|
// for ms level interval, calling Seconds and Minutes directly might trigger panic error
|
||||||
func (i Interval) Milliseconds() int {
|
func (i Interval) Milliseconds() int {
|
||||||
t := 0
|
t := 0
|
||||||
index := 0
|
index := 0
|
||||||
|
|
Loading…
Reference in New Issue
Block a user