mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
fix profit pointer check
This commit is contained in:
parent
8cf57cae29
commit
28666d4e98
|
@ -718,12 +718,15 @@ func (environ *Environment) RecordPosition(position *types.Position, trade types
|
|||
return
|
||||
}
|
||||
|
||||
if position.Strategy == "" && profit.Strategy != "" {
|
||||
position.Strategy = profit.Strategy
|
||||
}
|
||||
// set profit info to position
|
||||
if profit != nil {
|
||||
if position.Strategy == "" && profit.Strategy != "" {
|
||||
position.Strategy = profit.Strategy
|
||||
}
|
||||
|
||||
if position.StrategyInstanceID == "" && profit.StrategyInstanceID != "" {
|
||||
position.StrategyInstanceID = profit.StrategyInstanceID
|
||||
if position.StrategyInstanceID == "" && profit.StrategyInstanceID != "" {
|
||||
position.StrategyInstanceID = profit.StrategyInstanceID
|
||||
}
|
||||
}
|
||||
|
||||
if profit != nil {
|
||||
|
|
Loading…
Reference in New Issue
Block a user