Skip to main content

Onepy is an event-driven algorithmic trading Python library.

Project description

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 chenjiayicjy@gmail.com

Chandler_Chan

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

onepy_pro-1.1.5.tar.gz (59.9 kB view hashes)

Uploaded Source

Built Distribution

OnePy_pro-1.1.5-py3-none-any.whl (77.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page