mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
grid2: change fee rate validation
This commit is contained in:
parent
bbab8728e3
commit
427daba6d0
|
@ -114,7 +114,7 @@ func (s *Strategy) Validate() error {
|
||||||
|
|
||||||
if !s.ProfitSpread.IsZero() {
|
if !s.ProfitSpread.IsZero() {
|
||||||
percent := s.ProfitSpread.Div(s.LowerPrice)
|
percent := s.ProfitSpread.Div(s.LowerPrice)
|
||||||
feeRate := fixedpoint.NewFromFloat(0.075 * 0.01)
|
feeRate := fixedpoint.NewFromFloat(0.1 * 0.01) // 0.1%, 0.075% with BNB
|
||||||
if percent.Compare(feeRate) < 0 {
|
if percent.Compare(feeRate) < 0 {
|
||||||
return fmt.Errorf("profitSpread %f %s is too small, less than the fee rate: %s", s.ProfitSpread.Float64(), percent.Percentage(), feeRate.Percentage())
|
return fmt.Errorf("profitSpread %f %s is too small, less than the fee rate: %s", s.ProfitSpread.Float64(), percent.Percentage(), feeRate.Percentage())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user