mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-23 07:15:15 +00:00
29 lines
473 B
Go
29 lines
473 B
Go
|
package pivotshort
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func Test_findPossibleResistancePrices(t *testing.T) {
|
||
|
prices := findPossibleResistancePrices(19000.0, 0.01, []float64{
|
||
|
23020.0,
|
||
|
23040.0,
|
||
|
23060.0,
|
||
|
|
||
|
24020.0,
|
||
|
24040.0,
|
||
|
24060.0,
|
||
|
})
|
||
|
assert.Equal(t, []float64{23035, 24040}, prices)
|
||
|
|
||
|
|
||
|
prices = findPossibleResistancePrices(19000.0, 0.01, []float64{
|
||
|
23020.0,
|
||
|
23040.0,
|
||
|
23060.0,
|
||
|
})
|
||
|
assert.Equal(t, []float64{23035}, prices)
|
||
|
}
|