mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 23:05:15 +00:00
use RecordPosition
This commit is contained in:
parent
322f31a56a
commit
d67b800e7e
|
@ -52,9 +52,9 @@ type Strategy struct {
|
|||
*bbgo.Notifiability
|
||||
*bbgo.Persistence
|
||||
|
||||
Environment *bbgo.Environment
|
||||
Environment *bbgo.Environment
|
||||
StandardIndicatorSet *bbgo.StandardIndicatorSet
|
||||
Market types.Market
|
||||
Market types.Market
|
||||
|
||||
// Symbol is the market symbol you want to trade
|
||||
Symbol string `json:"symbol"`
|
||||
|
@ -143,7 +143,7 @@ type Strategy struct {
|
|||
bbgo.SmartStops
|
||||
|
||||
session *bbgo.ExchangeSession
|
||||
book *types.StreamOrderBook
|
||||
book *types.StreamOrderBook
|
||||
|
||||
state *State
|
||||
|
||||
|
@ -568,7 +568,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se
|
|||
p := s.state.Position.NewProfit(trade, profit, netProfit)
|
||||
p.Strategy = ID
|
||||
p.StrategyInstanceID = instanceID
|
||||
s.Environment.RecordProfit(p)
|
||||
s.Environment.RecordPosition(s.state.Position, trade, p)
|
||||
|
||||
s.state.ProfitStats.AddProfit(p)
|
||||
s.Notify(&p)
|
||||
|
|
Loading…
Reference in New Issue
Block a user