Code Monkey home page Code Monkey logo

alphahunter's Introduction

alphahunter

面向策略对象的异步事件驱动量化交易/做市系统。

框架依赖

  • 运行环境

    • python 3.5.3 或以上版本
  • 依赖python三方包

    • aiohttp>=3.2.1
    • aioamqp>=0.13.0
    • motor>=2.0.0 (可选)
  • RabbitMQ服务器

    • 事件发布、订阅
  • MongoDB数据库(可选)

    • 数据存储

安装

使用 pip 可以简单方便安装:

pip install alphahunter

目录说明

  • 文件夹:

    ./quant 量化基础框架

    ./example 量化策略模板例子

    ./collect 市场行情采集服务

  • 快速体验 Demo

框架说明

本框架使用的是Python原生异步库(asyncio)实现异步事件驱动,所以在使用之前,需要先了解 Python Asyncio

本框架利用面向对象**和面向接口编程**抽象出一个策略基础类 Strategy和一个交易所网关回调接口类ExchangeGateway.ICallBack,所有量化策略都需要继承自 Strategy基类并且实现 ExchangeGateway.ICallBack接口, Strategy自带了一个数据管理器 PortfolioManager用于统一缓存并管理相应策略的仓位,订单,资产,成交等信息。在策略中可以利用 Strategy.create_gateway创建指定的交易所网关与交易所建立连接进行交易,所有交易所网关类都需要继承自 ExchangeGateway并且实现其中的抽象方法。然后利用设计模式中的工厂模式和代理模式**实现了 Trader类,统一对各交易所进行创建和管理,在策略中调用 Strategy.create_gateway,其实其内部就是利用 Trader类创建指定的交易所网关与之建立连接,进行交易。

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.