mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 14:55:16 +00:00
optimizer: copy param slice
This commit is contained in:
parent
0f6989af8b
commit
43c2819d01
|
@ -135,13 +135,16 @@ func (o *GridOptimizer) Run(executor Executor, configJson []byte) ([]Metric, err
|
||||||
// TODO: Add more metric value function
|
// TODO: Add more metric value function
|
||||||
metricValue := TotalProfitMetricValueFunc(summaryReport)
|
metricValue := TotalProfitMetricValueFunc(summaryReport)
|
||||||
|
|
||||||
|
var currentParams []interface{}
|
||||||
|
copy(currentParams, o.CurrentParams)
|
||||||
|
|
||||||
metrics = append(metrics, Metric{
|
metrics = append(metrics, Metric{
|
||||||
Params: o.CurrentParams,
|
Params: currentParams,
|
||||||
Labels: o.ParamLabels,
|
Labels: o.ParamLabels,
|
||||||
Value: metricValue,
|
Value: metricValue,
|
||||||
})
|
})
|
||||||
|
|
||||||
log.Infof("current params: %+v => %+v", o.CurrentParams, metricValue)
|
log.Infof("current params: %+v => %+v", currentParams, metricValue)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user