mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +00:00
30 lines
560 B
Go
30 lines
560 B
Go
package bbgo
|
|
|
|
import (
|
|
"sync"
|
|
|
|
"github.com/c9s/bbgo/pkg/accounting"
|
|
"github.com/c9s/bbgo/pkg/accounting/pnl"
|
|
"github.com/c9s/bbgo/pkg/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
|
|
ProfitAndLossCalculator *pnl.AverageCostCalculator
|
|
StockManager *accounting.StockDistribution
|
|
}
|
|
|
|
func (c *Context) SetCurrentPrice(price float64) {
|
|
c.CurrentPrice = price
|
|
}
|