Code Monkey home page Code Monkey logo

yfdu1989 / tgw Goto Github PK

View Code? Open in Web Editor NEW
0.0 0.0 19.0 43 MB

**银河证券格物机构金融服务平台提供集数据接入、推送、查询、计算和分析为一体的投研数据解决方案,为机构和高净值个人用户提供市场前沿、可靠、全面、极速的金融数据api服务。

Home Page: http://www.chinastock.com.cn/newsite/cgs-services/strategyTrade/geWuInstitution.html

License: MIT License

Shell 0.23% C++ 54.03% Python 45.08% C 0.23% Makefile 0.24% Batchfile 0.20%

tgw's Introduction

tgw

Github workers GitHub stars GitHub forks

1.简介

(1)**银河证券格物机构金融服务平台提供集数据接入、推送、查询、计算和分析为一体的投研数据解决方案,为机构和高净值个人用户提供市场前沿、可靠、全面、极速的金融数据api服务。

(2)支持Python和C++两种编程语言

(3)支持Windows和linux两种操作系统

(4)支持的数据包括:

  • 实时推送K线数据(1/3/5/10/15/30/60/120分钟线)
  • Level1快照历史数据
  • K线历史数据(日/周/月/季年线、1/3/5/10/15/30/60/120分钟线)
  • 实时推送快照衍生指标数据
  • 实时推送加工因子数据
  • 证券个股基本信息查询
  • 证券代码表信息查询
  • 复权因子表信息查询
  • 加工因子历史数据
  • 金融资讯数据查询(财务数据、股东数据、龙虎榜数据等常用股票研究数据)
  • 实时推送Level1现货快照数据
  • 实时推送指数快照数据
  • 实时推送期权快照数据
  • 实时推送期货快照数据
  • 实时推送港股通快照数据
  • 实时推送盘后定价交易快照数据
  • 实时推送中证指数快照数据
  • 实时推送深交所国证指数快照数据
  • 实时推送港股通实时额度数据
  • 实时推送港股通产品状态快照数据
  • 港股市场波动调节机制(VCM)推送数据

2.Python api调用的主要代码demo

# -*- coding: utf-8 -*-
from tgw import tgw
import time
import signal

def Init():
    cfg = tgw.Cfg()

    # 服务器地址配置
    cfg.server_vip = "10.4.**.**"
    cfg.server_port = 9**0
    # 用户登录账号配置
    cfg.username = "z***"  # 账号
    cfg.password = "zd******"  # 密码
    # 运行模式配置
    api_mode = tgw.ApiMode.kColocationMode # 设置api模式 托管机房模式
    # api_mode = tgw.ApiMode.kInternetMode  # 设置api模式 互联网模式
    if (api_mode == tgw.ApiMode.kColocationMode):
        cfg.coloca_cfg.channel_mode = tgw.ColocatChannelMode.kQTCP  # tcp查询模式
        cfg.coloca_cfg.qtcp_channel_thread = 2
        cfg.coloca_cfg.qtcp_max_req_cnt = 1000

    # 初始化返回错误码,完成登录验证、运行模式设置、传实例到订阅方法三个功能
    error_code = tgw.IGMDApi_Init(spi, cfg, api_mode)
    # 如初始化失败,退出流程
    if error_code != tgw.ErrorCode.kSuccess:
        print("Init TGW failed")
        tgw.IGMDApi_Release()
        exit(-1)


def CtrlC(signum, frame):
    print("bey bey")
    global g_is_running
    g_is_running = False


if __name__ == "__main__":
    signal.signal(signal.SIGINT, CtrlC)
    signal.signal(signal.SIGTERM, CtrlC)

    g_is_running = True
    # ---------订阅spi实例---------
    spi = IAMDSpiApp()

    # ---------查询spi实例---------
    # k线查询spi实例
    spi_kline = IQueryKlineSpi()
    # 快照查询spi实例
    spi_snap = IQuerySnapshotSpi()
    # 逐笔委托查询spi实例
    spi_tick_order = IQueryTickOrderSpi()
    # 逐笔成交spi实例
    spi_tick_exec = IQueryTickExecutionSpi()
    # 委托队列spi实例
    spi_order_queue = IQueryOrderQueueSpi()
    # 代码表查询spi实例
    spi_code_table = IQueryCodeTableSpi()
    # 证券代码信息查询spi实例
    spi_secur_info = IQuerySecuritiesInfoSpi()
    # 复权因子表信息查询spi实例
    spi_ex_factor = IQueryExFactorSpi()
    # 加工因子查询spi实例
    spi_factor = IQueryFactorSpi()
    # 资讯数据查询spi实例
    spi_third_info = IQueryThirdInfoSpi()

    # ---------回放spi实例---------
    spi_replay = IReplayApp()

    Init()

    time.sleep(2)
    # 修改密码
    HandleUpdatePassword()
    # 订阅接口
    DealSub()
    # 查询接口
    DealQuery()
    # 回放接口
    DealReplay()

3.权限开通

(1)试用权限开通,可登录官网自助注册
官网: http://www.chinastock.com.cn/newsite/cgs-services/strategyTrade/geWuInstitution.html
流程如下:

(2)正式权限开通请咨询**银河证券营业部

4.联系方式

(1)格物官方联系企业微信:

(2)格物官方联系联系邮箱:
[email protected]

tgw's People

Contributors

tgw2023 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.