mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-22 06:53:52 +00:00
xmaker: solve scale in the Initialize() call
This commit is contained in:
parent
c0ee183426
commit
f1f5f1ff3a
|
@ -320,6 +320,29 @@ func (s *Strategy) Initialize() error {
|
||||||
"exchange": s.MakerExchange,
|
"exchange": s.MakerExchange,
|
||||||
"symbol": s.Symbol,
|
"symbol": s.Symbol,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if s.SignalReverseSideMarginScale != nil {
|
||||||
|
scale, err := s.SignalReverseSideMarginScale.Scale()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if solveErr := scale.Solve(); solveErr != nil {
|
||||||
|
return solveErr
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if s.SignalTrendSideMarginScale != nil {
|
||||||
|
scale, err := s.SignalTrendSideMarginScale.Scale()
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
if solveErr := scale.Solve(); solveErr != nil {
|
||||||
|
return solveErr
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1805,10 +1828,6 @@ func (s *Strategy) CrossRun(
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if solveErr := scale.Solve(); solveErr != nil {
|
|
||||||
return solveErr
|
|
||||||
}
|
|
||||||
|
|
||||||
minAdditionalMargin := scale.Call(0.0)
|
minAdditionalMargin := scale.Call(0.0)
|
||||||
middleAdditionalMargin := scale.Call(1.0)
|
middleAdditionalMargin := scale.Call(1.0)
|
||||||
maxAdditionalMargin := scale.Call(2.0)
|
maxAdditionalMargin := scale.Call(2.0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user