Skip to main content

all about fund investment

Project description

xalpha

version doc Travis codecov license

国内基金投资的全流程管理

场外基金的信息与净值获取,精确到分的投资账户记录整合分析与丰富可视化,简单的策略回测以及根据预设策略的定时投资提醒。尤其适合资金反复进出的定投型和网格型投资的概览与管理分析。

🎉 最新版本支持通用日线和实时数据获取器,统一接口一行可以获得几乎任何市场上存在产品的价格数据,进行分析。

一行拿到基金信息:

nfyy = xa.fundinfo("501018")

一行根据账单进行基金组合全模拟,和实盘完全相符:

jiaoyidan = xa.record(path).status # 额外一行先读入 path 处的 csv 账单
shipan = xa.mul(jiaoyidan) # Let's rock
shipan.combsummary() # 看所有基金总结效果

一行获取各种金融产品的历史日线数据或实时数据

xa.get_daily("SH518880") # 沪深市场历史数据
xa.get_daily("USD/CNY") # 人民币中间价历史数据
xa.get_rt("commodities/crude-oil") # 原油期货实时数据
xa.get_rt("HK00700", double_check=True) # 双重验证高稳定性支持的实时数据

一行拿到指数的历史估值和即时估值分析(需要聚宽数据,本地试用申请或直接在聚宽云平台运行)

xa.PEBHistory("SH000990").summary()

xalpha 不止如此,更多特性,欢迎探索。

您也可以尝试基于 xalpha 构建的基金净值预测与场内溢价率提醒的项目: LOF-BOT.

Documentation

文档地址: https://xalpha.readthedocs.io/

或者通过以下命令,在本地doc/build/html内阅读文档。

$ cd doc
$ make html

Installation

pip install xalpha

目前仅支持 python 3 。

若想要尝试最新版,

$ git clone https://github.com/refraction-ray/xalpha.git
$ cd xalpha && python3 setup.py install

Usage

本地使用

由于丰富的可视化支持,建议配合 Jupyter Notebook 使用。可以参照这里给出的示例连接,快速掌握大部分功能。

在量化平台使用

这里以聚宽为例,打开聚宽研究环境的 jupyter notebook,运行以下命令:

>>> !pip3 install xalpha --user
>>> import sys
>>> sys.path.insert(0, "/home/jquser/.local/lib/python3.6/site-packages")
>>> import xalpha as xa

即可在量化云平台正常使用 xalpha,并和云平台提供数据无缝结合。

如果想在云平台研究环境尝试最新开发版 xalpha,所需配置如下。

>>> !git clone https://github.com/refraction-ray/xalpha.git
>>> !cd xalpha && python3 setup.py develop --user
>>> import sys
>>> sys.path.insert(0, "/home/jquser/.local/lib/python3.6/site-packages")
>>> import xalpha as xa

由于 xalpha 整合了部分聚宽数据源的 API,在云端直接 xa.provider.set_jq_data(debug=True) 即可激活聚宽数据源。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xalpha-0.8.2.tar.gz (99.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xalpha-0.8.2-py3-none-any.whl (102.7 kB view details)

Uploaded Python 3

File details

Details for the file xalpha-0.8.2.tar.gz.

File metadata

  • Download URL: xalpha-0.8.2.tar.gz
  • Upload date:
  • Size: 99.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.20.1 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for xalpha-0.8.2.tar.gz
Algorithm Hash digest
SHA256 6bd20dd1c3e6f6358757944fcdd15c9b13e3b038a9dbdf72bf74a071be41c8fb
MD5 39bace879d68c9780b4793c0ccc3433b
BLAKE2b-256 9c49b36cdd6c9449ca85d51cff63687707c0f3a5c1e0a0192843d904dab8774e

See more details on using hashes here.

File details

Details for the file xalpha-0.8.2-py3-none-any.whl.

File metadata

  • Download URL: xalpha-0.8.2-py3-none-any.whl
  • Upload date:
  • Size: 102.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.20.1 setuptools/45.2.0 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.3

File hashes

Hashes for xalpha-0.8.2-py3-none-any.whl
Algorithm Hash digest
SHA256 fd55a851f0900a01ab26d5cec86bb353fbfca2565ee5d6dec28392ee6d27674f
MD5 1607e0f7ef7680b449bf9d0faebf48c4
BLAKE2b-256 f59b685250dcecfee0de7d1dc0444e338c67dbcb4dc7b34f271662c503ccd580

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page