Skip to content

Howtrader: A crypto quant framework for developing, backtesting, and executing your own trading strategies. Seamlessly integrates with TradingView and other third-party signals. Simply send a post request to automate trading and order placement. Supports Binance and Okex exchanges.

License

Notifications You must be signed in to change notification settings

eddy668/howtrader

Repository files navigation

HowTrader

中文文档

What does Howtrader means? It means how to be a trader, especially a quant trader.

The project is forked from VNPY, you can refer to the vnpy project. For easy to learn and easy to install the vnpy project. I just simply remove the other part not related to cryptocurrency.

Installation

the easies way to install the project is using pip to install it.

pip install git+https://github.com/51bitquant/howtrader.git

the projejct is developed an test mainly under python 3.9, so I recommend you to use the python 3.9 version. To create the python 3.9 version, we recommend you to use the anaconda to to create a virtual env.

如果提示你没有git, 那么你需要去安装git软件,具体的话参考系列课程的第十三课的视频。

或者你直接把代码下载下来,然后切换到你的虚拟环境,或者使用当前的环境也是可以的, 在终端输入:

pip install -r requirements.txt

python setup.py install

or you can directly download the source code. then open your termal, then script the following command

pip install -r requirements.txt

python setup.py install

但是我们直接推荐你用pip来安装,这样它能帮你把各种依赖处理好,减少错误的发生。

but we recommend you using the pip to install the howtrader, for you can encounter some unexpected errors.

Update

the codes is under active maintain, to upgrade to a new version, run the following command:

pip install git+https://github.com/51bitquant/howtrader.git -U

使用 Usage

你需要在项目下面创建一个文件夹howtrader, 这个主要是存放一些日记和配置文件的信息。 如果不不知道配置文件如何配置,你可以启动examples文件目录下面的main_window.py文件,就可以看到其下面的一些日志和配置文件信息了。

  1. firstly you need to create a folder(howtrader) at your project, at this folder, there are log file or configuration file. If you're not sure how to config, you can simply run the main_window.py at examples folder, you can play with UI.

数据爬取

howtrader可以通过data_manager的app直接下载数据,但是这个过程比较慢,适合少量数据的更新。 如果你想批量获取数据,可以参考examples下面的download_data_demo2.py文件.

you can download the data through data_manage app, but it's pretty slow, it just designs for small piece of data updating and strategy data warming. If you want to download the data as soon as possible, you can try the download_data_demo2.py or download_data_demo1.py at examples folder by using the multi-threads for speeding.

learning materials 学习资料

学习资料请参考网易云课堂《VNPY数字货币量化交易从零到实盘》 你也可以在youtube或者b站找到相应的视频,搜索51bitquant即可找到视频。

updates

  1. V2.1.7.3 update the binance gateway for klines, subscribe the 1min kline for kline update, V2.1.7.3版本更新了币安的K线数据的更新。

  2. V2.1.7.4 Order Status management for bad network or disconnection, V2.1.7.4版本对订单状态查询和更新, 特别是在在网络失去连接的时候能够进行查询和更新。

  3. V2.1.7.5 update the on_trade event and binance future api position 更新对on_trade交易事件的推送,websocket断开的时候订单的成交能够重新推送,并且能够计算策略的仓位。

  4. V2.1.7.6 : update the position. 对订阅的交易对,都会推送其头寸的更新.

  5. V2.1.7.7 add the position_update_interval and order_update_interval, 添加对订单和仓位信息的更新频率.

  6. V2.1.7.8 move the default strategies to example/strategies folders 把内置的策略移到example/strategies文件夹.

  7. V2.1.7.9 account update interval and binance_spot_grid_strategy 添加资产更新的定时推送和币安现货网格交易的策略。

  8. V2.1.8 增加现货和合约网格策略 add spot and future grid strategies

  9. V2.1.8.1 修改接口的api关于资产的推送问题.

  10. V2.2.0 修改接口的bug,仓位模式为both,防止币安推送错误数据。 Change the position mode to BOTH to avoid the rubbish data pushed from Binance Exchange.

  11. V2.2.1 添加策略编辑功能 Edit Strategy

  12. V2.2.3 添加马丁策略 martingle strategies

  13. V2.2.4 修改自动设置单项持仓.

联系方式

微信: bitquant51

discord: 51bitquant#8078

币安邀请链接

About

Howtrader: A crypto quant framework for developing, backtesting, and executing your own trading strategies. Seamlessly integrates with TradingView and other third-party signals. Simply send a post request to automate trading and order placement. Supports Binance and Okex exchanges.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 99.9%
  • Other 0.1%