mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 08:45:16 +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
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if position.Strategy == "" && profit.Strategy != "" {
|
// set profit info to position
|
||||||
position.Strategy = profit.Strategy
|
if profit != nil {
|
||||||
}
|
if position.Strategy == "" && profit.Strategy != "" {
|
||||||
|
position.Strategy = profit.Strategy
|
||||||
|
}
|
||||||
|
|
||||||
if position.StrategyInstanceID == "" && profit.StrategyInstanceID != "" {
|
if position.StrategyInstanceID == "" && profit.StrategyInstanceID != "" {
|
||||||
position.StrategyInstanceID = profit.StrategyInstanceID
|
position.StrategyInstanceID = profit.StrategyInstanceID
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if profit != nil {
|
if profit != nil {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user