Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
zengbin93
czsc
提交
d26ebdc1
C
czsc
项目概览
zengbin93
/
czsc
通知
23
Star
2
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
4
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
czsc
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
4
Issue
4
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
d26ebdc1
编写于
6月 02, 2020
作者:
Z
zengbin93
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
0.3.5 正式更名为“缠中说禅(czsc)”
上级
556e99a6
变更
15
隐藏空白更改
内联
并排
Showing
15 changed file
with
38 addition
and
39 deletion
+38
-39
README.md
README.md
+6
-3
czsc/__init__.py
czsc/__init__.py
+1
-1
czsc/analyze.py
czsc/analyze.py
+1
-1
czsc/solid.py
czsc/solid.py
+0
-0
czsc/ta.py
czsc/ta.py
+0
-0
czsc/utils.py
czsc/utils.py
+1
-1
examples/combine_with_goldminer.py
examples/combine_with_goldminer.py
+2
-2
examples/combine_with_tushare.py
examples/combine_with_tushare.py
+2
-2
examples/jq_monitor.py
examples/jq_monitor.py
+1
-1
examples/trade_simulator.py
examples/trade_simulator.py
+4
-4
examples/xd_end/make_data.py
examples/xd_end/make_data.py
+2
-2
requirements.txt
requirements.txt
+2
-1
setup.py
setup.py
+9
-9
test/test_analyze.py
test/test_analyze.py
+4
-4
test/test_solid.py
test/test_solid.py
+3
-8
未找到文件。
README.md
浏览文件 @
d26ebdc1
...
@@ -6,11 +6,14 @@
...
@@ -6,11 +6,14 @@
## 安装
## 安装
Pypi上已经存在一个名为chan的库,以致于这个库没法上传到Pypi。
执行以下代码直接从github安装:
执行以下代码直接从github安装:
```
```
pip install git+git://github.com/zengbin93/chan.git -U
pip install git+git://github.com/zengbin93/czsc.git -U
```
执行以下代码从 pypi 安装:
```
pip install czsc -U -i
```
```
## K线数据样例
## K线数据样例
...
...
c
han
/__init__.py
→
c
zsc
/__init__.py
浏览文件 @
d26ebdc1
...
@@ -7,7 +7,7 @@ from .solid import SolidAnalyze
...
@@ -7,7 +7,7 @@ from .solid import SolidAnalyze
from
.solid
import
is_in_tolerance
,
is_first_buy
,
is_first_sell
,
is_second_buy
,
\
from
.solid
import
is_in_tolerance
,
is_first_buy
,
is_first_sell
,
is_second_buy
,
\
is_second_sell
,
is_third_buy
,
is_third_sell
,
is_xd_buy
,
is_xd_sell
is_second_sell
,
is_third_buy
,
is_third_sell
,
is_xd_buy
,
is_xd_sell
__version__
=
"0.3.
4
"
__version__
=
"0.3.
5
"
__author__
=
"zengbin93"
__author__
=
"zengbin93"
__email__
=
"zeng_bin8888@163.com"
__email__
=
"zeng_bin8888@163.com"
...
...
c
han
/analyze.py
→
c
zsc
/analyze.py
浏览文件 @
d26ebdc1
...
@@ -176,7 +176,7 @@ class KlineAnalyze(object):
...
@@ -176,7 +176,7 @@ class KlineAnalyze(object):
self
.
__update_kline
()
self
.
__update_kline
()
def
__repr__
(
self
):
def
__repr__
(
self
):
return
"<
chan.analyze.
KlineAnalyze of %s, from %s to %s>"
%
(
self
.
symbol
,
self
.
start_dt
,
self
.
end_dt
)
return
"<KlineAnalyze of %s, from %s to %s>"
%
(
self
.
symbol
,
self
.
start_dt
,
self
.
end_dt
)
@
staticmethod
@
staticmethod
def
_preprocess
(
kline
):
def
_preprocess
(
kline
):
...
...
c
han
/solid.py
→
c
zsc
/solid.py
浏览文件 @
d26ebdc1
文件已移动
c
han
/ta.py
→
c
zsc
/ta.py
浏览文件 @
d26ebdc1
文件已移动
c
han
/utils.py
→
c
zsc
/utils.py
浏览文件 @
d26ebdc1
...
@@ -11,7 +11,7 @@ import matplotlib.pyplot as plt
...
@@ -11,7 +11,7 @@ import matplotlib.pyplot as plt
from
.ta
import
macd
from
.ta
import
macd
def
plot_kline
(
ka
,
bs
=
None
,
file_html
=
"
chan
.html"
,
width
=
"1400px"
,
height
=
"680px"
):
def
plot_kline
(
ka
,
bs
=
None
,
file_html
=
"
kline
.html"
,
width
=
"1400px"
,
height
=
"680px"
):
"""
"""
:param ka: KlineAnalyze
:param ka: KlineAnalyze
...
...
examples/combine_with_goldminer.py
浏览文件 @
d26ebdc1
# coding: utf-8
# coding: utf-8
"""
"""
结合掘金的数据使用 c
han
进行缠论技术分析
结合掘金的数据使用 c
zsc
进行缠论技术分析
author: zengbin93
author: zengbin93
email: zeng_bin8888@163.com
email: zeng_bin8888@163.com
...
@@ -10,7 +10,7 @@ date: 2020-02-02
...
@@ -10,7 +10,7 @@ date: 2020-02-02
from
gm.api
import
*
from
gm.api
import
*
from
datetime
import
datetime
from
datetime
import
datetime
from
c
han
import
KlineAnalyze
,
SolidAnalyze
from
c
zsc
import
KlineAnalyze
,
SolidAnalyze
# 在这里设置你的掘金token,用于获取数据
# 在这里设置你的掘金token,用于获取数据
set_token
(
"your gm token"
)
set_token
(
"your gm token"
)
...
...
examples/combine_with_tushare.py
浏览文件 @
d26ebdc1
# coding: utf-8
# coding: utf-8
"""
"""
结合 tushare.pro 的数据使用 c
han
进行缠论技术分析
结合 tushare.pro 的数据使用 c
zsc
进行缠论技术分析
author: zengbin93
author: zengbin93
email: zeng_bin8888@163.com
email: zeng_bin8888@163.com
...
@@ -10,7 +10,7 @@ date: 2020-02-02
...
@@ -10,7 +10,7 @@ date: 2020-02-02
import
tushare
as
ts
import
tushare
as
ts
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
c
han
import
KlineAnalyze
,
SolidAnalyze
from
c
zsc
import
KlineAnalyze
,
SolidAnalyze
# 首次使用,需要在这里设置你的 tushare token,用于获取数据;在同一台机器上,tushare token 只需要设置一次
# 首次使用,需要在这里设置你的 tushare token,用于获取数据;在同一台机器上,tushare token 只需要设置一次
# 没有 token,到 https://tushare.pro/register?reg=7 注册获取
# 没有 token,到 https://tushare.pro/register?reg=7 注册获取
...
...
examples/jq_monitor.py
浏览文件 @
d26ebdc1
...
@@ -7,7 +7,7 @@ import time
...
@@ -7,7 +7,7 @@ import time
import
pandas
as
pd
import
pandas
as
pd
from
datetime
import
datetime
from
datetime
import
datetime
from
apscheduler.schedulers.blocking
import
BlockingScheduler
from
apscheduler.schedulers.blocking
import
BlockingScheduler
from
c
han
import
SolidAnalyze
from
c
zsc
import
SolidAnalyze
# 企业微信群聊机器人 web hook
# 企业微信群聊机器人 web hook
hook
=
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=******"
hook
=
"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=******"
...
...
examples/trade_simulator.py
浏览文件 @
d26ebdc1
...
@@ -3,8 +3,8 @@
...
@@ -3,8 +3,8 @@
交易模拟器,用于研究单标的的买卖点变化过程
交易模拟器,用于研究单标的的买卖点变化过程
"""
"""
import
c
han
import
c
zsc
print
(
c
han
.
__version__
)
print
(
c
zsc
.
__version__
)
import
os
import
os
import
time
import
time
...
@@ -13,8 +13,8 @@ import pandas as pd
...
@@ -13,8 +13,8 @@ import pandas as pd
from
copy
import
deepcopy
from
copy
import
deepcopy
import
tushare
as
ts
import
tushare
as
ts
from
datetime
import
datetime
,
timedelta
from
datetime
import
datetime
,
timedelta
from
c
han
import
SolidAnalyze
,
KlineAnalyze
from
c
zsc
import
SolidAnalyze
,
KlineAnalyze
from
c
han
import
plot_kline
from
c
zsc
import
plot_kline
# 首次使用,需要在这里设置你的 tushare token,用于获取数据;在同一台机器上,tushare token 只需要设置一次
# 首次使用,需要在这里设置你的 tushare token,用于获取数据;在同一台机器上,tushare token 只需要设置一次
...
...
examples/xd_end/make_data.py
浏览文件 @
d26ebdc1
...
@@ -7,8 +7,8 @@ from copy import deepcopy
...
@@ -7,8 +7,8 @@ from copy import deepcopy
from
datetime
import
timedelta
,
datetime
from
datetime
import
timedelta
,
datetime
from
cobra.data.kline
import
kline_simulator
,
get_kline
from
cobra.data.kline
import
kline_simulator
,
get_kline
from
cobra.data.basic
import
is_trade_day
from
cobra.data.basic
import
is_trade_day
from
c
han
import
SolidAnalyze
,
KlineAnalyze
from
c
zsc
import
SolidAnalyze
,
KlineAnalyze
from
c
han
.analyze
import
is_macd_cross
from
c
zsc
.analyze
import
is_macd_cross
data_path
=
"./data"
data_path
=
"./data"
if
not
os
.
path
.
exists
(
data_path
):
if
not
os
.
path
.
exists
(
data_path
):
...
...
requirements.txt
浏览文件 @
d26ebdc1
...
@@ -3,4 +3,5 @@ mplfinance
...
@@ -3,4 +3,5 @@ mplfinance
tqdm
tqdm
pandas
pandas
tushare
tushare
git+git://github.com/zengbin93/cobra.git
git+git://github.com/zengbin93/cobra.git
\ No newline at end of file
matplotlib
setup.py
浏览文件 @
d26ebdc1
# coding: utf-8
# coding: utf-8
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
import
c
han
import
c
zsc
setup
(
setup
(
name
=
"c
han
"
,
name
=
"c
zsc
"
,
version
=
c
han
.
__version__
,
version
=
c
zsc
.
__version__
,
author
=
c
han
.
__author__
,
author
=
c
zsc
.
__author__
,
author_email
=
c
han
.
__email__
,
author_email
=
c
zsc
.
__email__
,
keywords
=
[
"缠论"
,
"技术分析"
,
"A股"
,
"期货"
],
keywords
=
[
"缠论"
,
"技术分析"
,
"A股"
,
"期货"
],
description
=
"缠
论
技术分析工具"
,
description
=
"缠
中说禅
技术分析工具"
,
long_description
=
"缠
论技术分析工具
"
,
long_description
=
"缠
中说禅技术分析工具,源自 http://blog.sina.com.cn/chzhshch
"
,
license
=
"MIT"
,
license
=
"MIT"
,
url
=
"https://github.com/zengbin93/c
han
"
,
url
=
"https://github.com/zengbin93/c
zsc
"
,
packages
=
find_packages
(
exclude
=
[
'test'
,
'images'
,
'docs'
]),
packages
=
find_packages
(
exclude
=
[
'test'
,
'images'
,
'docs'
]),
include_package_data
=
True
,
include_package_data
=
True
,
install_requires
=
[
"pandas"
,
"pyecharts"
,
"mplfinance"
,
"tushare"
],
install_requires
=
[
"pandas"
,
"pyecharts"
,
"mplfinance"
,
"tushare"
,
"matplotlib"
],
classifiers
=
[
classifiers
=
[
'License :: OSI Approved :: Apache Software License'
,
'License :: OSI Approved :: Apache Software License'
,
...
...
test/test_analyze.py
浏览文件 @
d26ebdc1
...
@@ -3,11 +3,11 @@ import sys
...
@@ -3,11 +3,11 @@ import sys
from
cobra.data.kline
import
get_kline
from
cobra.data.kline
import
get_kline
sys
.
path
.
insert
(
0
,
'.'
)
sys
.
path
.
insert
(
0
,
'.'
)
sys
.
path
.
insert
(
0
,
'..'
)
sys
.
path
.
insert
(
0
,
'..'
)
import
c
han
import
c
zsc
from
c
han
import
KlineAnalyze
from
c
zsc
import
KlineAnalyze
from
c
han
.analyze
import
is_bei_chi
from
c
zsc
.analyze
import
is_bei_chi
print
(
c
han
.
__version__
)
print
(
c
zsc
.
__version__
)
def
test_bei_chi
():
def
test_bei_chi
():
...
...
test/test_solid.py
浏览文件 @
d26ebdc1
...
@@ -3,9 +3,9 @@ import sys
...
@@ -3,9 +3,9 @@ import sys
from
cobra.data.kline
import
get_klines
from
cobra.data.kline
import
get_klines
sys
.
path
.
insert
(
0
,
'.'
)
sys
.
path
.
insert
(
0
,
'.'
)
sys
.
path
.
insert
(
0
,
'..'
)
sys
.
path
.
insert
(
0
,
'..'
)
import
c
han
import
c
zsc
from
c
han.solid
import
SolidAnalyze
,
nested_intervals
,
is_in_tolerance
from
c
zsc.solid
import
SolidAnalyze
,
is_in_tolerance
print
(
c
han
.
__version__
)
print
(
c
zsc
.
__version__
)
def
test_in_tolerance
():
def
test_in_tolerance
():
...
@@ -22,11 +22,6 @@ def test_solid_analyze():
...
@@ -22,11 +22,6 @@ def test_solid_analyze():
klines
=
get_klines
(
ts_code
,
end_date
=
'2020-04-03 14:00:00'
,
asset
=
'I'
,
freqs
=
'1min,5min,30min,D'
)
klines
=
get_klines
(
ts_code
,
end_date
=
'2020-04-03 14:00:00'
,
asset
=
'I'
,
freqs
=
'1min,5min,30min,D'
)
sa
=
SolidAnalyze
(
klines
)
sa
=
SolidAnalyze
(
klines
)
ka
=
sa
.
kas
[
'30分钟'
]
ka1
=
sa
.
kas
[
'日线'
]
ka2
=
sa
.
kas
[
'5分钟'
]
print
(
nested_intervals
(
ka
,
ka1
,
ka2
))
# for func in [sa.is_first_buy, sa.is_first_sell, sa.is_second_buy, sa.is_second_sell,
# for func in [sa.is_first_buy, sa.is_first_sell, sa.is_second_buy, sa.is_second_sell,
# sa.is_third_buy, sa.is_third_sell, sa.is_xd_buy, sa.is_xd_sell]:
# sa.is_third_buy, sa.is_third_sell, sa.is_xd_buy, sa.is_xd_sell]:
# for freq in ['1分钟', '5分钟', '30分钟']:
# for freq in ['1分钟', '5分钟', '30分钟']:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录