Coder Social home page Coder Social logo

yang123vc / open-trade-gateway Goto Github PK

View Code? Open in Web Editor NEW

This project forked from wyrover/open-trade-gateway

0.0 2.0 0.0 15.73 MB

Diff协议中继网关, 支持 CTP / FEMAS / UFX 等交易系统

Home Page: http://www.shinnytech.com/diff

License: GNU General Public License v3.0

Makefile 0.05% C++ 74.33% C 25.62%

open-trade-gateway's Introduction

Introduction

Open Trade Gateway 是一套主要用于期货交易的中继服务器系统. 它可以接受客户端以 DIFF协议 (Differential Information Flow for Finance) 接入, 完成用户终端与期货柜台系统的数据交互.

本项目目前支持的期货交易柜台系统包括:

  • CTP
  • Femas 主席系统 (测试中)
  • 恒生 UFX 系统 (测试中)

DIFF Collection 中列出了一些支持本系统的终端产品

Install

本服务必须在Linux环境下安装运行。下面的安装步骤以 Debian 9 为例,其它 linux 发行版可能需要相应调整.

安装 openssl, libcurl, boost 等依赖库

用apt命令安装 openssl 和 libcurl:

sudo apt install libcurl4-openssl-dev

安装 boost 1.68.0, 参见 https://www.boost.org/doc/libs/1_68_0/more/getting_started/unix-variants.html

安装 open-trade-gateway

获取 open-trade-gateway 代码:

git clone https://github.com/shinnytech/open-trade-gateway.git

编译:

cd open-trade-gateway
make
sudo make install

Config

本系统运行需要两个配置文件:

/etc/open-trade-gateway/config.json 用于服务进程的一些配置项:

{
  "host": "0.0.0.0",                                      //提供服务的IP地址  
  "port": 7788,                                           //提供服务的端口号
  "auto_confirm_settlement": false,                       //是否自动确认结算单
  "user_file_path": "/var/local/lib/open-trade-gateway"   //存放用户文件的目录,必须事先创建好
}

/etc/open-trade-gateway/broker_list.json 中可以设置一组或多组期货公司前置机:

[
  {
    "name": "simnow",
    "type": "ctp",                              //交易系统类型
    "broker_id": "9999",                        //broker_id, 必须与交易系统中的设置一致
    "product_info": "abcd",
    "trading_fronts": [                         //交易前置机地址
      "tcp://218.202.237.33:10002"
    ]
  }
]

Run

在命令行下运行服务器主程序:

open_trade_gateway

系统运行日志将输出到 /var/log/open-trade-gateway

Test

主程序启动后,用任意websocket client 连接到服务端口,应该收到这样的信息:

{
  "aid": "rtn_brokers",
  "brokers": ["simnow"]
}

表示服务器主程序启动正常

open-trade-gateway's People

Contributors

shinny-yangyang avatar shinny-chengzhi avatar yymailb avatar

Watchers

deger avatar  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.