Skip to content

Commit

Permalink
feat: fixbug for position not update
Browse files Browse the repository at this point in the history
  • Loading branch information
yubing744 committed Mar 16, 2024
1 parent 0ec4ef2 commit 0ec19fb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/env/exchange/exchange_entity.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ func (ent *ExchangeEntity) Actions() []*ttypes.ActionDesc {
Description: "开启做多仓位",
Args: []ttypes.ArgmentDesc{
{
Name: "stop_loss",
Name: "stop_loss_trigge_price",
Description: "Stop-loss trigger price",
},
{
Name: "take_profit",
Name: "take_profit_trigger_price",
Description: "Take-profit trigger price",
},
},
Expand Down
1 change: 1 addition & 0 deletions pkg/jarvis.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ func (s *Strategy) Run(ctx context.Context, orderExecutor bbgo.OrderExecutor, se

// Sync position to redis on trade
s.orderExecutor.TradeCollector().OnPositionUpdate(func(position *types.Position) {
log.WithField("position", position).Info("Strategy_OnPositionUpdate")
bbgo.Sync(ctx, s)
})

Expand Down

0 comments on commit 0ec19fb

Please sign in to comment.