mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
techsignal: if it's already high funding rate, do not show change
This commit is contained in:
parent
a2c2646a16
commit
7a3963b34e
|
@ -107,28 +107,30 @@ func (s *Strategy) listenToFundingRate(ctx context.Context, exchange *binance.Ex
|
|||
fundingRate := index.LastFundingRate
|
||||
|
||||
if fundingRate >= s.FundingRate.High {
|
||||
s.Notifiability.Notify("%s funding rate is too high! current %s > threshold %s",
|
||||
s.Notifiability.Notify("%s funding rate %s is too high! threshold %s",
|
||||
s.Symbol,
|
||||
fundingRate.Percentage(),
|
||||
s.FundingRate.High.Percentage(),
|
||||
)
|
||||
}
|
||||
} else {
|
||||
if previousIndex != nil {
|
||||
if s.FundingRate.DiffThreshold == 0 {
|
||||
// 0.6%
|
||||
s.FundingRate.DiffThreshold = fixedpoint.NewFromFloat(0.006 * 0.01)
|
||||
}
|
||||
|
||||
if previousIndex != nil {
|
||||
if s.FundingRate.DiffThreshold == 0 {
|
||||
s.FundingRate.DiffThreshold = fixedpoint.NewFromFloat(0.005 * 0.01)
|
||||
}
|
||||
|
||||
diff := fundingRate - previousIndex.LastFundingRate
|
||||
if diff.Abs() > s.FundingRate.DiffThreshold {
|
||||
s.Notifiability.Notify("%s funding rate changed %s, current funding rate %s",
|
||||
s.Symbol,
|
||||
diff.SignedPercentage(),
|
||||
fundingRate.Percentage(),
|
||||
)
|
||||
diff := fundingRate - previousIndex.LastFundingRate
|
||||
if diff.Abs() > s.FundingRate.DiffThreshold {
|
||||
s.Notifiability.Notify("%s funding rate changed %s, current funding rate %s",
|
||||
s.Symbol,
|
||||
diff.SignedPercentage(),
|
||||
fundingRate.Percentage(),
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
previousIndex = index
|
||||
if fundingRate24HoursLowIndex != nil {
|
||||
if fundingRate24HoursLowIndex.Time.Before(time.Now().Add(24 * time.Hour)) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user