mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
clean up the legacy context struct
This commit is contained in:
parent
752fdf5c80
commit
3b3df77ec3
|
@ -10,7 +10,6 @@ import (
|
|||
"github.com/pkg/errors"
|
||||
)
|
||||
|
||||
|
||||
type DataFetcher func() (interface{}, error)
|
||||
|
||||
// WithCache let you use the cache with the given cache key, variable reference and your data fetcher,
|
||||
|
|
|
@ -2,28 +2,10 @@ package bbgo
|
|||
|
||||
import (
|
||||
"sync"
|
||||
|
||||
"github.com/c9s/bbgo/pkg/accounting"
|
||||
"github.com/c9s/bbgo/pkg/accounting/pnl"
|
||||
"github.com/c9s/bbgo/pkg/types"
|
||||
)
|
||||
|
||||
// deprecated: legacy context struct
|
||||
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
|
||||
ProfitAndLossCalculator *pnl.AverageCostCalculator
|
||||
StockManager *accounting.StockDistribution
|
||||
}
|
||||
|
||||
func (c *Context) SetCurrentPrice(price float64) {
|
||||
c.CurrentPrice = price
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user