diff --git a/README.md b/README.md index 8faeaa4f1a33bb732576ab49220500c8cdfc8189..0c355495270ab178ff1c18e56ff1249dcca7f9d8 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,14 @@ ## 安装 -Pypi上已经存在一个名为chan的库,以致于这个库没法上传到Pypi。 - 执行以下代码直接从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线数据样例 diff --git a/chan/__init__.py b/czsc/__init__.py similarity index 94% rename from chan/__init__.py rename to czsc/__init__.py index 082dad7a7fb0d2a1530b2685988f0a6ba312b760..74744345f11e907cee1b66843b514ea33b8d222d 100644 --- a/chan/__init__.py +++ b/czsc/__init__.py @@ -7,7 +7,7 @@ from .solid import SolidAnalyze 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 -__version__ = "0.3.4" +__version__ = "0.3.5" __author__ = "zengbin93" __email__ = "zeng_bin8888@163.com" diff --git a/chan/analyze.py b/czsc/analyze.py similarity index 99% rename from chan/analyze.py rename to czsc/analyze.py index 89f0e7104d48aeefcdd7f710b3d03a5b4456e388..82c225d9bf34d87e07458a3ae61800d4c7b46461 100644 --- a/chan/analyze.py +++ b/czsc/analyze.py @@ -176,7 +176,7 @@ class KlineAnalyze(object): self.__update_kline() def __repr__(self): - return "" % (self.symbol, self.start_dt, self.end_dt) + return "" % (self.symbol, self.start_dt, self.end_dt) @staticmethod def _preprocess(kline): diff --git a/chan/solid.py b/czsc/solid.py similarity index 100% rename from chan/solid.py rename to czsc/solid.py diff --git a/chan/ta.py b/czsc/ta.py similarity index 100% rename from chan/ta.py rename to czsc/ta.py diff --git a/chan/utils.py b/czsc/utils.py similarity index 99% rename from chan/utils.py rename to czsc/utils.py index 1f3a380b252dae038afaa7ceb833848d14d42526..a00c7dc3f10d5b0311c7247b7f78dacac16e4ec0 100644 --- a/chan/utils.py +++ b/czsc/utils.py @@ -11,7 +11,7 @@ import matplotlib.pyplot as plt 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 diff --git a/examples/combine_with_goldminer.py b/examples/combine_with_goldminer.py index c1fa596b53bb6d2e942a3f7c296c7b46b636ec97..31757cda540c528cefe335c66c50e83a5dff6494 100644 --- a/examples/combine_with_goldminer.py +++ b/examples/combine_with_goldminer.py @@ -1,6 +1,6 @@ # coding: utf-8 """ -结合掘金的数据使用 chan 进行缠论技术分析 +结合掘金的数据使用 czsc 进行缠论技术分析 author: zengbin93 email: zeng_bin8888@163.com @@ -10,7 +10,7 @@ date: 2020-02-02 from gm.api import * from datetime import datetime -from chan import KlineAnalyze, SolidAnalyze +from czsc import KlineAnalyze, SolidAnalyze # 在这里设置你的掘金token,用于获取数据 set_token("your gm token") diff --git a/examples/combine_with_tushare.py b/examples/combine_with_tushare.py index 146efe678641c56db64d14a2aa9e74e82f5fe53c..6ccfb75ce14ed2768e6973ce36bb9bc012d45680 100644 --- a/examples/combine_with_tushare.py +++ b/examples/combine_with_tushare.py @@ -1,6 +1,6 @@ # coding: utf-8 """ -结合 tushare.pro 的数据使用 chan 进行缠论技术分析 +结合 tushare.pro 的数据使用 czsc 进行缠论技术分析 author: zengbin93 email: zeng_bin8888@163.com @@ -10,7 +10,7 @@ date: 2020-02-02 import tushare as ts from datetime import datetime, timedelta -from chan import KlineAnalyze, SolidAnalyze +from czsc import KlineAnalyze, SolidAnalyze # 首次使用,需要在这里设置你的 tushare token,用于获取数据;在同一台机器上,tushare token 只需要设置一次 # 没有 token,到 https://tushare.pro/register?reg=7 注册获取 diff --git a/examples/jq_monitor.py b/examples/jq_monitor.py index b336ec8f29da13693c486bef647ed00f19869f8c..09bfd70bfa73bb05f9bc413d62548dcc62c6a993 100644 --- a/examples/jq_monitor.py +++ b/examples/jq_monitor.py @@ -7,7 +7,7 @@ import time import pandas as pd from datetime import datetime from apscheduler.schedulers.blocking import BlockingScheduler -from chan import SolidAnalyze +from czsc import SolidAnalyze # 企业微信群聊机器人 web hook hook = "https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=******" diff --git a/examples/trade_simulator.py b/examples/trade_simulator.py index bae86a346081b16afba5e906cdc3a4c6eb35421c..826aaaee68a5ea805b6ddcea22dac845d8d92da0 100644 --- a/examples/trade_simulator.py +++ b/examples/trade_simulator.py @@ -3,8 +3,8 @@ 交易模拟器,用于研究单标的的买卖点变化过程 """ -import chan -print(chan.__version__) +import czsc +print(czsc.__version__) import os import time @@ -13,8 +13,8 @@ import pandas as pd from copy import deepcopy import tushare as ts from datetime import datetime, timedelta -from chan import SolidAnalyze, KlineAnalyze -from chan import plot_kline +from czsc import SolidAnalyze, KlineAnalyze +from czsc import plot_kline # 首次使用,需要在这里设置你的 tushare token,用于获取数据;在同一台机器上,tushare token 只需要设置一次 diff --git a/examples/xd_end/make_data.py b/examples/xd_end/make_data.py index 7d5e58579f34382c1a5f1ada1031e1fce1d28475..1a9a1d0b90b8544de3bc4e4d63d2699e3a1480ba 100644 --- a/examples/xd_end/make_data.py +++ b/examples/xd_end/make_data.py @@ -7,8 +7,8 @@ from copy import deepcopy from datetime import timedelta, datetime from cobra.data.kline import kline_simulator, get_kline from cobra.data.basic import is_trade_day -from chan import SolidAnalyze, KlineAnalyze -from chan.analyze import is_macd_cross +from czsc import SolidAnalyze, KlineAnalyze +from czsc.analyze import is_macd_cross data_path = "./data" if not os.path.exists(data_path): diff --git a/requirements.txt b/requirements.txt index 5f7eeccd690d7772e70b3740feb17d3b88d503f5..a7b88a7ac6bbeec490cd2b1a348f37697e2755a1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,5 @@ mplfinance tqdm pandas tushare -git+git://github.com/zengbin93/cobra.git \ No newline at end of file +git+git://github.com/zengbin93/cobra.git +matplotlib diff --git a/setup.py b/setup.py index cf22c8ca119deee55e6da6f188cebaa195b7b68d..767df83d31cfc60afc03eb7f358917ecec44586b 100644 --- a/setup.py +++ b/setup.py @@ -1,21 +1,21 @@ # coding: utf-8 from setuptools import setup, find_packages -import chan +import czsc setup( - name="chan", - version=chan.__version__, - author=chan.__author__, - author_email=chan.__email__, + name="czsc", + version=czsc.__version__, + author=czsc.__author__, + author_email=czsc.__email__, keywords=["缠论", "技术分析", "A股", "期货"], - description="缠论技术分析工具", - long_description="缠论技术分析工具", + description="缠中说禅技术分析工具", + long_description="缠中说禅技术分析工具,源自 http://blog.sina.com.cn/chzhshch", license="MIT", - url="https://github.com/zengbin93/chan", + url="https://github.com/zengbin93/czsc", packages=find_packages(exclude=['test', 'images', 'docs']), include_package_data=True, - install_requires=["pandas", "pyecharts", "mplfinance", "tushare"], + install_requires=["pandas", "pyecharts", "mplfinance", "tushare", "matplotlib"], classifiers=[ 'License :: OSI Approved :: Apache Software License', diff --git a/test/test_analyze.py b/test/test_analyze.py index 96616aac1af13e3786568d6f7388302f321b2993..3749d8121e1d621bfe3337dbba9cb206bf1492f7 100644 --- a/test/test_analyze.py +++ b/test/test_analyze.py @@ -3,11 +3,11 @@ import sys from cobra.data.kline import get_kline sys.path.insert(0, '.') sys.path.insert(0, '..') -import chan -from chan import KlineAnalyze -from chan.analyze import is_bei_chi +import czsc +from czsc import KlineAnalyze +from czsc.analyze import is_bei_chi -print(chan.__version__) +print(czsc.__version__) def test_bei_chi(): diff --git a/test/test_solid.py b/test/test_solid.py index 69cda3788c658b7e6faae89f0cd02cd16b639e58..6e20636c08d61e0fa21f4d58067277f024bca424 100644 --- a/test/test_solid.py +++ b/test/test_solid.py @@ -3,9 +3,9 @@ import sys from cobra.data.kline import get_klines sys.path.insert(0, '.') sys.path.insert(0, '..') -import chan -from chan.solid import SolidAnalyze, nested_intervals, is_in_tolerance -print(chan.__version__) +import czsc +from czsc.solid import SolidAnalyze, is_in_tolerance +print(czsc.__version__) def test_in_tolerance(): @@ -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') 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, # sa.is_third_buy, sa.is_third_sell, sa.is_xd_buy, sa.is_xd_sell]: # for freq in ['1分钟', '5分钟', '30分钟']: