mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +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.
|
// trade sync and market data store depends on subscribed symbols so we have to do this here.
|
||||||
for symbol := range session.loadedSymbols {
|
for symbol := range session.loadedSymbols {
|
||||||
|
session.positions[symbol] = &Position{Symbol: symbol}
|
||||||
|
|
||||||
var trades []types.Trade
|
var trades []types.Trade
|
||||||
|
|
||||||
if environ.TradeSync != nil {
|
if environ.TradeSync != nil {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
type Position struct {
|
type Position struct {
|
||||||
|
Symbol string `json:"symbol"`
|
||||||
Base fixedpoint.Value `json:"base"`
|
Base fixedpoint.Value `json:"base"`
|
||||||
Quote fixedpoint.Value `json:"quote"`
|
Quote fixedpoint.Value `json:"quote"`
|
||||||
AverageCost fixedpoint.Value `json:"averageCost"`
|
AverageCost fixedpoint.Value `json:"averageCost"`
|
||||||
|
|
Loading…
Reference in New Issue
Block a user