提交 d26ebdc1 编写于 作者: Z zengbin93

0.3.5 正式更名为“缠中说禅(czsc)”

上级 556e99a6
...@@ -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线数据样例
......
...@@ -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"
......
...@@ -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):
......
...@@ -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
......
# coding: utf-8 # coding: utf-8
""" """
结合掘金的数据使用 chan 进行缠论技术分析 结合掘金的数据使用 czsc 进行缠论技术分析
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 chan import KlineAnalyze, SolidAnalyze from czsc import KlineAnalyze, SolidAnalyze
# 在这里设置你的掘金token,用于获取数据 # 在这里设置你的掘金token,用于获取数据
set_token("your gm token") set_token("your gm token")
......
# coding: utf-8 # coding: utf-8
""" """
结合 tushare.pro 的数据使用 chan 进行缠论技术分析 结合 tushare.pro 的数据使用 czsc 进行缠论技术分析
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 chan import KlineAnalyze, SolidAnalyze from czsc 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 注册获取
......
...@@ -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 chan import SolidAnalyze from czsc 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=******"
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
交易模拟器,用于研究单标的的买卖点变化过程 交易模拟器,用于研究单标的的买卖点变化过程
""" """
import chan import czsc
print(chan.__version__) print(czsc.__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 chan import SolidAnalyze, KlineAnalyze from czsc import SolidAnalyze, KlineAnalyze
from chan import plot_kline from czsc import plot_kline
# 首次使用,需要在这里设置你的 tushare token,用于获取数据;在同一台机器上,tushare token 只需要设置一次 # 首次使用,需要在这里设置你的 tushare token,用于获取数据;在同一台机器上,tushare token 只需要设置一次
......
...@@ -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 chan import SolidAnalyze, KlineAnalyze from czsc import SolidAnalyze, KlineAnalyze
from chan.analyze import is_macd_cross from czsc.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):
......
...@@ -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
# coding: utf-8 # coding: utf-8
from setuptools import setup, find_packages from setuptools import setup, find_packages
import chan import czsc
setup( setup(
name="chan", name="czsc",
version=chan.__version__, version=czsc.__version__,
author=chan.__author__, author=czsc.__author__,
author_email=chan.__email__, author_email=czsc.__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/chan", url="https://github.com/zengbin93/czsc",
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',
......
...@@ -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 chan import czsc
from chan import KlineAnalyze from czsc import KlineAnalyze
from chan.analyze import is_bei_chi from czsc.analyze import is_bei_chi
print(chan.__version__) print(czsc.__version__)
def test_bei_chi(): def test_bei_chi():
......
...@@ -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 chan import czsc
from chan.solid import SolidAnalyze, nested_intervals, is_in_tolerance from czsc.solid import SolidAnalyze, is_in_tolerance
print(chan.__version__) print(czsc.__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.
先完成此消息的编辑!
想要评论请 注册