mirror of
https://github.com/injoyai/tdx.git
synced 2025-11-26 21:25:35 +08:00
增加income,用于计算未来收益
This commit is contained in:
36
example/Income/main.go
Normal file
36
example/Income/main.go
Normal file
@@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/injoyai/logs"
|
||||
"github.com/injoyai/tdx/extend"
|
||||
"time"
|
||||
)
|
||||
|
||||
func main() {
|
||||
code := "sz000001"
|
||||
|
||||
pull := extend.NewPullKline(extend.PullKlineConfig{
|
||||
Codes: []string{code},
|
||||
Tables: []string{extend.Day},
|
||||
})
|
||||
|
||||
//m, err := tdx.NewManage(nil)
|
||||
//logs.PanicErr(err)
|
||||
|
||||
//err = pull.Run(context.Background(), m)
|
||||
//logs.PanicErr(err)
|
||||
|
||||
ks, err := pull.DayKlines(code)
|
||||
logs.PanicErr(err)
|
||||
|
||||
t := time.Now().AddDate(0, -1, -9)
|
||||
logs.Debug(t.Format(time.DateOnly))
|
||||
ls := extend.DoIncomes(ks, t, 5, 10, 20)
|
||||
|
||||
logs.Debug(len(ls))
|
||||
|
||||
for _, v := range ls {
|
||||
logs.Info(v)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user