mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-26 00:35:15 +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
|
||||
metricValue := TotalProfitMetricValueFunc(summaryReport)
|
||||
|
||||
var currentParams []interface{}
|
||||
copy(currentParams, o.CurrentParams)
|
||||
|
||||
metrics = append(metrics, Metric{
|
||||
Params: o.CurrentParams,
|
||||
Params: currentParams,
|
||||
Labels: o.ParamLabels,
|
||||
Value: metricValue,
|
||||
})
|
||||
|
||||
log.Infof("current params: %+v => %+v", o.CurrentParams, metricValue)
|
||||
log.Infof("current params: %+v => %+v", currentParams, metricValue)
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user