-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathtest.py
More file actions
60 lines (41 loc) · 723 Bytes
/
test.py
File metadata and controls
60 lines (41 loc) · 723 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from Klang import (
C,O,Klang,
REF,REFDATE,
MA,
SMA,
HHV,LLV,
DATE,
ABS,
EVERY, EXIST
)
Klang.Klang_init()
Kl = Klang.Kl
code = Kl.code
date = Kl.date
# 设置为隆基
code('sh.601012')
print(C)
print(Kl.currentdf['df'])
# 设置为茅台
code('sh.600519')
print(C)
date(start='2022-01-26',end='2022-04-29')
print(C)
#显示当天TCL的收盘价
code('sz.000100')
date()
print(C)
# 系列比,可以计算出每天的涨幅
print(C.data,C[1].data)
print(C/C[1])
print(REF(C,1))
print(REFDATE(C,'20210429'))
print(MA(C,5))
print(SMA(C,5,1))
print(HHV(C,10))
print(LLV(C,10))
print(EVERY(C<O,10))
code('sh.600392')
print(EVERY(C<O,2))
print(ABS(C-O))
print(EXIST(C<O,10))