Code Monkey home page Code Monkey logo

onepy's Introduction

Onepy 2.51

Onepy is an event-driven algorithmic trading Python library.

更新日志:Change Log

Install

Onepy is developed using Anaconda Python 3.6.x.

pip install plotly
pip install funcy
pip install arrow
pip install pymongo
pip install retry
pip install TA-Lib
pip install dataclasses # python 3.7不用安装

将该项目解压后,参照这里将OnePy项目文件夹添加到Python搜索目录

Getting Started

Main Features

OnePy 综合方面:

  • 事件驱动回测设计 ✓
  • 股票、外汇回测 ✓
  • 多品种回测 ✓
  • 多策略回测 ✓
  • 设置手续费, 保证金/手, 杠杆大小 ✓
  • 设置成交价格为 close 或者第二天 open ✓
  • 设置是否打印交易日志 ✓
  • Plot 画图模块 ✓
  • 多进程参数优化 ✓
  • 多进程Fordward analysis ✓

Tools 工具方面:

  • To_MongoDB:自定义数据统一格式后存入数据库 ✓
  • To_MongoDB:tushare 股票数据 CSV 存入数据库 ✓
  • Tushare API 数据多线程存入 MongoDB ✓
  • Oanda API 数据导入MongoDB ✓

DataHandler 数据方面:

  • CSV 数据读取 ✓
  • MongoDB 数据读取 ✓

Strategy 策略方面:

  • 做多 buy & sell, 做空 sell & cover 指令 ✓
  • 撤单 cancel_pennding, cancel_tst 指令 ✓
  • 按百分比或盈亏多少钱, 设置止盈 Limit、止损 Stop 和 Trailingstop 移动止损 ✓
  • 按百分比或者指定价格, 建立挂单。 ✓
  • 技术指标 Cleaner 模块 ✓
  • 整合 Talib 模块 ✓

Broker 执行方面:

  • 模拟发送指令 ✓
  • 模拟检查指令是否发送成功 ✓
  • 打印交易日志 ✓
  • 手续费 commission, 百分比类型和固定类型 ✓

Recorder 日志方面:

  • 计算保证金, 仓位, 浮动利润, 已平仓利润, 总资金, 剩余现金, 收益率, 市值, 时间序列化 ✓
  • 输出交易记录, 包括出场时间, 入场时间, 盈亏点数, 盈亏利润等 ✓
  • 详细盘后交易结果分析 ✓

延展性方面:

  • 在 Environment 中存有原始所有信号信息, 生成的订单信息, 便于分析 ✓
  • 自定义扩展事件源 ✓
  • 自定义数据源, 返回迭代器给 OnePy 即可 ✓
  • 自定义策略模块 ✓
  • 自定义技术指标模块 ✓
  • 自定义风控模块 ✓
  • 自定义经纪商模块 ✓
  • 自定义日志记录模块 ✓

Quick Look

Plot Plot Plot

Road Map

执行过程

Contact

I'm very interested in your experience with Onepy.Please feel free to contact me via [email protected]

Chandler_Chan

onepy's People

Contributors

chandlercjy avatar

Watchers

 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.