bbgo_origin/bbgo/context.go
2020-09-19 09:05:06 +08:00

30 lines
571 B
Go

package bbgo
import (
"sync"
"github.com/c9s/bbgo/pkg/bbgo/accounting"
"github.com/c9s/bbgo/pkg/bbgo/types"
)
type Context 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 *accounting.ProfitAndLossCalculator
StockManager *StockManager
}
func (c *Context) SetCurrentPrice(price float64) {
c.CurrentPrice = price
}