mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
fix profit stats and position
This commit is contained in:
parent
a4f996c963
commit
da02c926be
|
@ -11,8 +11,8 @@ type MultiMarketStrategy struct {
|
|||
Environ *bbgo.Environment
|
||||
Session *bbgo.ExchangeSession
|
||||
|
||||
PositionMap PositionMap `persistence:"positionMap"`
|
||||
ProfitStatsMap ProfitStatsMap `persistence:"profitStatsMap"`
|
||||
PositionMap PositionMap `persistence:"position_map"`
|
||||
ProfitStatsMap ProfitStatsMap `persistence:"profit_stats_map"`
|
||||
OrderExecutorMap GeneralOrderExecutorMap
|
||||
|
||||
parent, ctx context.Context
|
||||
|
|
|
@ -54,6 +54,10 @@ func (s *Strategy) Defaults() error {
|
|||
}
|
||||
|
||||
func (s *Strategy) Initialize() error {
|
||||
if s.MultiMarketStrategy == nil {
|
||||
s.MultiMarketStrategy = &MultiMarketStrategy{}
|
||||
}
|
||||
|
||||
for currency := range s.TargetWeights {
|
||||
if currency == s.QuoteCurrency {
|
||||
continue
|
||||
|
@ -105,7 +109,6 @@ func (s *Strategy) Run(ctx context.Context, _ bbgo.OrderExecutor, session *bbgo.
|
|||
s.markets[symbol] = market
|
||||
}
|
||||
|
||||
s.MultiMarketStrategy = &MultiMarketStrategy{}
|
||||
s.MultiMarketStrategy.Initialize(ctx, s.Environment, session, s.markets, ID)
|
||||
|
||||
s.activeOrderBook = bbgo.NewActiveOrderBook("")
|
||||
|
|
Loading…
Reference in New Issue
Block a user