bbgo_origin/bbgo/context.go
2020-08-04 18:45:36 +08:00

28 lines
530 B
Go

package bbgo
import (
"github.com/c9s/bbgo/pkg/bbgo/types"
"sync"
)
type TradingContext struct {
sync.Mutex
Symbol string
// Market is the market configuration of a symbol
Market types.Market
AverageBidPrice float64
CurrentPrice float64
Balances map[string]types.Balance
Quota map[string]types.Balance
ProfitAndLossCalculator *ProfitAndLossCalculator
StockManager *StockManager
}
func (c *TradingContext) SetCurrentPrice(price float64) {
c.CurrentPrice = price
}