Skip to content

Commit

Permalink
tradingview
Browse files Browse the repository at this point in the history
  • Loading branch information
51bitquant committed Jul 4, 2022
1 parent 4bcfddd commit 61ec70d
Show file tree
Hide file tree
Showing 10 changed files with 1,568 additions and 29 deletions.
143 changes: 143 additions & 0 deletions README-CN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,143 @@
# 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.

这个项目是fork vnpy的代码。为了方便区分,我把名字改成了howtrader,
并对其中的部分代码进行了修改,主要为了方便大家学习和使用。vnpy的安装非常复杂,而且容易出错。主要是因为里面依赖的东西过多。
而且很多部分我们是用不到的。

# 安装 installation

1. 直接安装该软件的安装包,下载地址: https://share.weiyun.com/LhKEc3cQ

安装软件后相应配置文件和数据库放在用户目录下面,对于MacOS系统,配置文件在:
/Users/你的电脑用户名/howtrader, Window系统在: C:\Users\你电脑用户名\howtrader


2. 或者通过一下方式安装源码:

直接在终端输入:
> pip install git+https://github.com/51bitquant/howtrader.git
you can use pip to install the howtrader.

> pip install git+https://github.com/51bitquant/howtrader.git
if you encounter the error with --use-feature=2020-resolver, you can
solve with the following command:
> pip install git+https://github.com/51bitquant/howtrader.git --use-feature=2020-resolver
如果安装报错,可能各个包之间存在冲突,可以通过以下命令解决:
> pip install git+https://github.com/51bitquant/howtrader.git --use-feature=2020-resolver
如果提示你没有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
直接在终端输入:

> 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数字货币量化交易从零到实盘》](https://study.163.com/course/courseMain.htm?courseId=1210904816)
你也可以在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

[币安邀请链接](https://www.binancezh.pro/cn/futures/ref/51bitquant)












44 changes: 15 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,24 @@
# how trader
How to be a (quant) trader.
如何成为一个量化交易者
# HowTrader

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.

这个项目是fork vnpy的代码。为了方便区分,我把名字改成了howtrader,
并对其中的部分代码进行了修改,主要为了方便大家学习和使用。vnpy的安装非常复杂,而且容易出错。主要是因为里面依赖的东西过多。
而且很多部分我们是用不到的。
What does Howtrader means? It means how to be a trader, especially a
quant trader.

# 安装 installation

1. 直接安装该软件的安装包,下载地址: https://share.weiyun.com/LhKEc3cQ

安装软件后相应配置文件和数据库放在用户目录下面,对于MacOS系统,配置文件在:
/Users/你的电脑用户名/howtrader, Window系统在: C:\Users\你电脑用户名\howtrader
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.


2. 或者通过一下方式安装源码:
## Installation

直接在终端输入:
the easies way to install the project is using pip to install it.
> pip install git+https://github.com/51bitquant/howtrader.git
you can use pip to install the howtrader.

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

if you encounter the error with --use-feature=2020-resolver, you can
solve with the following command:
> pip install git+https://github.com/51bitquant/howtrader.git --use-feature=2020-resolver

如果安装报错,可能各个包之间存在冲突,可以通过以下命令解决:
> pip install git+https://github.com/51bitquant/howtrader.git --use-feature=2020-resolver

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

Expand All @@ -55,13 +41,13 @@ then script the following command
but we recommend you using the pip to install the howtrader, for you can
encounter some unexpected errors.

# 更新版本 update
直接在终端输入:
# 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文件,就可以看到其下面的一些日志和配置文件信息了。
Expand Down
17 changes: 17 additions & 0 deletions howtrader/app/tradingview/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from pathlib import Path

from howtrader.trader.app import BaseApp

from .engine import TVEngine, APP_NAME


class TradingViewApp(BaseApp):
""""""

app_name = APP_NAME
app_module = __module__
app_path = Path(__file__).parent
display_name = "Tradingview"
engine_class = TVEngine
widget_name = "TVManager"
icon_name = str(app_path.joinpath("ui", "tv.ico"))
Loading

0 comments on commit 61ec70d

Please sign in to comment.