Skip to content

Commit

Permalink
update en doc
Browse files Browse the repository at this point in the history
  • Loading branch information
foolcage committed Jun 30, 2019
1 parent d760b90 commit d7980aa
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 63 deletions.
74 changes: 12 additions & 62 deletions README-en.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,80 +7,30 @@

**Read this in other languages: [English](README-en.md).**

ZVT是在[fooltrader](https://github.com/foolcage/fooltrader)的基础上重新思考后编写的量化项目,其包含可扩展的数据recorder,api,因子计算,选股,回测,定位为日线级别全市场分析和交易框架。
ZVT is a quant trading platform written after rethinking trading based on [fooltrader] (https://github.com/foolcage/fooltrader), which includes scalable data recorder, api, factor calculation, stock picking, backtesting, which focus on **low frequency**, **multi-level**, **multi-targets** full market analysis and trading framework.

# 使用方式
```
pip install -U zvt
```

# 使用展示
[*参考代码*](./zvt/trader/examples)
### 单标的回测 ###
# examples
[*code examples*](./zvt/trader/examples)
### single target backtesting ###

#### 股票单标的单factor(cross ma) ####
```
class SingleStockTrader(StockTrader):
def __init__(self,
security: str = 'stock_sz_000338',
start_timestamp: Union[str, pd.Timestamp] = '2005-01-01',
end_timestamp: Union[str, pd.Timestamp] = '2019-06-30',
provider: Union[str, Provider] = 'joinquant',
level: Union[str, TradingLevel] = TradingLevel.LEVEL_1DAY,
trader_name: str = None,
real_time: bool = False,
kdata_use_begin_time: bool = True) -> None:
super().__init__([security], SecurityType.stock, None, None, start_timestamp, end_timestamp, provider,
level, trader_name, real_time, kdata_use_begin_time=kdata_use_begin_time)
def init_selectors(self, security_list, security_type, exchanges, codes, start_timestamp, end_timestamp):
self.selectors = []
technical_selector = TechnicalSelector(security_list=security_list, security_type=security_type,
exchanges=exchanges, codes=codes,
start_timestamp=start_timestamp,
end_timestamp=end_timestamp, level=TradingLevel.LEVEL_1DAY,
provider='joinquant')
technical_selector.run()
#### single stock with one factor(cross ma) ####

self.selectors.append(technical_selector)
```
<p align="center"><img src='./docs/single-stock-cross-ma.gif'/></p>

#### 股票多单标的单factor(macd) ####
```
class MultipleStockTrader(StockTrader):
def __init__(self,
security_list: List[str] = None,
exchanges: List[str] = ['sh', 'sz'],
codes: List[str] = None,
start_timestamp: Union[str, pd.Timestamp] = None,
end_timestamp: Union[str, pd.Timestamp] = None,
provider: Union[str, Provider] = 'joinquant',
level: Union[str, TradingLevel] = TradingLevel.LEVEL_1DAY,
trader_name: str = None,
real_time: bool = False,
kdata_use_begin_time: bool = False) -> None:
super().__init__(security_list, SecurityType.stock, exchanges, codes, start_timestamp, end_timestamp, provider,
level, trader_name, real_time, kdata_use_begin_time)
#### multiple stocks with one factor(macd) ####

def init_selectors(self, security_list, security_type, exchanges, codes, start_timestamp, end_timestamp):
my_selector = TargetSelector(security_list=security_list, security_type=security_type, exchanges=exchanges,
codes=codes, start_timestamp=start_timestamp,
end_timestamp=end_timestamp)
# add the factors
my_selector \
.add_filter_factor(BullFactor(security_list=security_list,
security_type=security_type,
exchanges=exchanges,
codes=codes,
start_timestamp=start_timestamp,
end_timestamp=end_timestamp,
level=TradingLevel.LEVEL_1DAY))
self.selectors.append(my_selector)
```
<p align="center"><img src='./docs/multiple-stock-macd.gif'/></p>

#### realtime trading signals ####
<p align="center"><img src='./docs/realtime_signals.gif'/></p>

# 联系方式
QQ群:300911873 加群请备注github用户名
# Contact information
QQ group:300911873
if you like this project,please star it and tell me your github user name when joining the qq group
check http://www.imqq.com/html/FAQ_en/html/Discussions_3.html
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
# For a discussion on single-sourcing the version across setup.py and the
# project code, see
# https://packaging.python.org/en/latest/single_source_version.html
version='0.0.4', # Required
version='0.0.5', # Required

# This is a one-line description or tagline of what your project does. This
# corresponds to the "Summary" metadata field:
Expand Down

0 comments on commit d7980aa

Please sign in to comment.