init
This commit is contained in:
28
ptn/common.go
Normal file
28
ptn/common.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package ptn
|
||||
|
||||
import (
|
||||
ta "github.com/banbox/banta"
|
||||
)
|
||||
|
||||
func GetMains(e *ta.BarEnv, i int) (float64, float64, float64, float64) {
|
||||
o, h, l, c := e.Open.Get(i), e.High.Get(i), e.Low.Get(i), e.Close.Get(i)
|
||||
return o, h, l, c
|
||||
}
|
||||
|
||||
type FuncPtnRecognize = func(e *ta.BarEnv) *PtnRes
|
||||
|
||||
var (
|
||||
recognizers = []FuncPtnRecognize{
|
||||
isEngulfing,
|
||||
}
|
||||
)
|
||||
|
||||
func Recognize(e *ta.BarEnv) *PtnRes {
|
||||
for _, reg := range recognizers {
|
||||
res := reg(e)
|
||||
if res != nil {
|
||||
return res
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
Reference in New Issue
Block a user