mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
init position with loaded symbols
This commit is contained in:
parent
0051dbc78a
commit
c2a27b031e
|
@ -190,6 +190,8 @@ func (environ *Environment) Init(ctx context.Context) (err error) {
|
|||
|
||||
// trade sync and market data store depends on subscribed symbols so we have to do this here.
|
||||
for symbol := range session.loadedSymbols {
|
||||
session.positions[symbol] = &Position{Symbol: symbol}
|
||||
|
||||
var trades []types.Trade
|
||||
|
||||
if environ.TradeSync != nil {
|
||||
|
|
|
@ -6,6 +6,7 @@ import (
|
|||
)
|
||||
|
||||
type Position struct {
|
||||
Symbol string `json:"symbol"`
|
||||
Base fixedpoint.Value `json:"base"`
|
||||
Quote fixedpoint.Value `json:"quote"`
|
||||
AverageCost fixedpoint.Value `json:"averageCost"`
|
||||
|
|
Loading…
Reference in New Issue
Block a user