Skip to main content

TianGong Quantitative Investment Research Analysis Client

Project description

tgtrader

天工量化投研分析客户端

  • 提供开箱即用的分析工具
  • 对于小白,可以直接使用可视化分析工具,零代码开启量化分析
  • 对于有一定经验的开发者,结合使用sdk开发,更加灵活

安装

pip install tgtrader

如果网络不通,可以使用国内镜像源
pip install tgtrader -i https://mirrors.aliyun.com/pypi/simple/

更新日志

v0.1.0

  • 支持获取国内ETF数据、股票数据(使用AKShare获取数据)

使用说明

获取数据

from tgtrader.data import DataGetter
from tgtrader.common import PriceAdjust, Period, SecurityType

symbols = [
    '511260',  # 十年国债ETF
    '159915',  # 创业板ETF
    '510500',  # 500ETF
    '159919',  # 沪深300ETF
    '510880',  # 红利ETF
    '518880',  # 黄金ETF
    '513100',  # 纳指ETF
]


data_getter = DataGetter()
df = data_getter.get_data(symbols, 
                            "2010-01-01", 
                            "2024-11-30", 
                            period=Period.Day, 
                            fields=["open","close","high","low","volume"], 
                            security_type=SecurityType.ETF,
                            adjust=PriceAdjust.HFQ)
df
参数 类型 说明 示例值
symbols List[str] 证券代码列表 ['511260', '159915']
start_date str 开始日期,格式为YYYY-MM-DD '2010-01-01'
end_date str 结束日期,格式为YYYY-MM-DD '2024-11-30'
period Period 数据周期,可选值:Day(日线)、Week(周线)、Month(月线) Period.Day
fields List[str] 需要获取的字段,可选值:open、close、high、low、volume ['open', 'close']
security_type SecurityType 证券类型,可选值:ETF、Stock SecurityType.ETF
adjust PriceAdjust 价格复权方式,可选值:None(不复权)、QFQ(前复权)、HFQ(后复权) PriceAdjust.HFQ

alt text

微信公众号: 天工量化

关注即可获取

  1. tgtrader的最佳实践:如何用好tgtrader以提高投研效率
  2. 研报复现:各大券商研报复现,源码公开
  3. 策略分享:基于tg量化工具集,实现各类策略
  4. 实盘跟踪:已上线的实盘策略持续跟进

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

tgtrader-0.1.0.tar.gz (52.0 kB view details)

Uploaded Source

Built Distribution

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

tgtrader-0.1.0-py3-none-any.whl (53.3 kB view details)

Uploaded Python 3

File details

Details for the file tgtrader-0.1.0.tar.gz.

File metadata

  • Download URL: tgtrader-0.1.0.tar.gz
  • Upload date:
  • Size: 52.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.9

File hashes

Hashes for tgtrader-0.1.0.tar.gz
Algorithm Hash digest
SHA256 95217b72eea33e6d704a475495cf077791044af452bce9854f4a0221fac67df9
MD5 aa8977ec45a7efc1f981affcb3add82f
BLAKE2b-256 2c9809bef7133f4638ca9885f25c89b3ff61bca500d5c82f9798f6af26a1a90e

See more details on using hashes here.

File details

Details for the file tgtrader-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: tgtrader-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 53.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.9

File hashes

Hashes for tgtrader-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 96cc79fc4bc3d6565558446e28a68e0bb920c416a8572d5bea11bbe5b36388ff
MD5 6e13122b44cb60cdac0b9261b32ec4be
BLAKE2b-256 850edfa1b85287d6e5ab353dd792fda890ad665a2f32af6389618a88c1564b4f

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