mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
pivotshort: rename strategy & fix pivot indicator
This commit is contained in:
parent
1a441425b5
commit
8ab696deaa
|
@ -7,7 +7,7 @@ sessions:
|
|||
|
||||
exchangeStrategies:
|
||||
- on: binance
|
||||
pivot:
|
||||
pivotshort:
|
||||
symbol: BTCBUSD
|
||||
interval: 1h
|
||||
quantity: 0.95
|
|
@ -13,7 +13,7 @@ import (
|
|||
_ "github.com/c9s/bbgo/pkg/strategy/funding"
|
||||
_ "github.com/c9s/bbgo/pkg/strategy/grid"
|
||||
_ "github.com/c9s/bbgo/pkg/strategy/kline"
|
||||
_ "github.com/c9s/bbgo/pkg/strategy/pivot"
|
||||
_ "github.com/c9s/bbgo/pkg/strategy/pivotshort"
|
||||
_ "github.com/c9s/bbgo/pkg/strategy/pricealert"
|
||||
_ "github.com/c9s/bbgo/pkg/strategy/pricedrop"
|
||||
_ "github.com/c9s/bbgo/pkg/strategy/rebalance"
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
package pivot
|
||||
package pivotshort
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
@ -99,11 +99,11 @@ func calculatePivot(klines []types.KLine, window int, valLow KLineValueMapper, v
|
|||
}
|
||||
|
||||
pl := 0.
|
||||
if lows.Min() == lows.Index(int(window/2.)) {
|
||||
if lows.Min() == lows.Index(int(window/2.)-1) {
|
||||
pl = lows.Min()
|
||||
}
|
||||
ph := 0.
|
||||
if highs.Max() == highs.Index(int(window/2.)) {
|
||||
if highs.Max() == highs.Index(int(window/2.)-1) {
|
||||
ph = highs.Max()
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
// Code generated by "callbackgen -type Pivot"; DO NOT EDIT.
|
||||
|
||||
package pivot
|
||||
package pivotshort
|
||||
|
||||
import ()
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package pivot
|
||||
package pivotshort
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
@ -9,7 +9,7 @@ import (
|
|||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const ID = "pivot"
|
||||
const ID = "pivotshort"
|
||||
|
||||
var fifteen = fixedpoint.NewFromInt(15)
|
||||
var three = fixedpoint.NewFromInt(3)
|
Loading…
Reference in New Issue
Block a user