Skip to content

Commit

Permalink
📃 docs: 更新文档
Browse files Browse the repository at this point in the history
使用教程全面校对
  • Loading branch information
aaron-yang-biz committed Oct 30, 2023
1 parent 3c6676f commit a47b96e
Show file tree
Hide file tree
Showing 7 changed files with 293 additions and 73 deletions.
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@

## 简介

Omicron是Zillionare的核心公共模块,向其它模块提供行情数据、交易日历、证券列表、时间操作及Trigger等功能。
Omicron是Zillionare的核心模块,提供以下功能:

1. 行情数据读取(需要启动[zillionare-omega](https://github.com/zillionare/omega)服务。
2. [概念板块数据](/api/board),也需要启动[zillionare-omega](https://github.com/zillionare/omega)服务。
3. [交易日历及时间帧相关操作](/api/timeframe)
4. [证券列表及相关查询操作](/api/security)
5. [numpy数组功能扩展](/api/omicron/#extensions-package)
6. [技术指标及形态分析功能](/api/talib])
1. 各种均线、曲线拟合、直线斜率和夹解计算、曲线平滑函数等。
2. 形态分析功能,如交叉、顶底搜索、平台检测、RSI背离等。
7. [策略编写框架](/usage#stragety),不修改代码即可同时用于实盘与回测。
8. 绘图功能。提供了[交互式k线图](/usage#candlestick)[回测报告](/usage#metrics)
9. 其它
1. 修正Python的round函数错误,改用[math_round](/api/omicron/#extensions.decimal)
2. 判断价格是否相等的函数:[price_equal](/api/omicron/#extensions.decimal)

Omicron是大富翁量化框架的一部分。您必须至少安装并运行[Omega](https://zillionare.github.io/omega),然后才能利用omicron来访问上述数据。

Expand Down
3 changes: 3 additions & 0 deletions docs/api/extensions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
::: omicron.extensions
rendering:
heading_level: 1
308 changes: 247 additions & 61 deletions docs/usage.md

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,27 @@ repo_name: omicron
nav:
- 简介: index.md
- 安装: installation.md
- 快速入门: usage.md
- 使用教程: usage.md
- 版本历史: history.md
- 开发者文档: developer.md
- API文档:
- omicron: api/omicron.md
- timeframe: api/timeframe.md
- triggers: api/triggers.md
- stock: api/stock.md
- security: api/security.md
- board: api/board.md
- 行情数据:
- timeframe: api/timeframe.md
- stock: api/stock.md
- security: api/security.md
- board: api/board.md
- metrics: api/metrics.md
- talib: api/talib.md
- strategy: api/strategy.md
- plotting:
- 策略框架: api/strategy.md
- 绘图:
- CandleStick: api/plotting/candlestick.md
- MetricsGraph: api/plotting/metrics.md
- dal:
- Flux: api/dal/flux.md
- InfluxClient: api/dal/influxclient.md
- Serialize: api/dal/serialize.md

theme:
name: material

Expand Down
18 changes: 17 additions & 1 deletion omicron/models/board.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,23 @@ async def _rpc_call(cls, url: str, param: str):
return {"rc": 200, "data": rsp}

@classmethod
async def board_list(cls, _btype: BoardType = BoardType.CONCEPT):
async def board_list(cls, _btype: BoardType = BoardType.CONCEPT) -> List[List]:
"""获取板块列表
Args:
_btype: 板块类别,可选值`BoardType.CONCEPT`和`BoardType.INDUSTRY`.
Returns:
板块列表。每一个子元素仍为一个列表,由板块代码(str), 板块名称(str)和成员数组成。示例:
```
[
['881101', '种植业与林业', 24],
['881102', '养殖业', 27],
['881103', '农产品加工', 41],
['881104', '农业服务', 16],
]
```
"""
rsp = await cls._rpc_call("board_list", {"board_type": _btype.value})
if rsp["rc"] != 200:
return {"status": 500, "msg": "httpx RPC call failed"}
Expand Down
2 changes: 1 addition & 1 deletion omicron/models/stock.py
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,7 @@ async def trade_price_limit_flags_ex(
) -> Dict[datetime.date, Tuple[bool, bool]]:
"""获取股票`code`在`[start, end]`区间的涨跌停标志
!!!Note:
!!!Note
如果end为当天,注意在未收盘之前,这个涨跌停标志都是不稳定的
Args:
Expand Down
2 changes: 1 addition & 1 deletion omicron/plotting/candlestick.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ def __init__(
width: the width in 'px' units of the figure
height: the height in 'px' units of the figure
Keyword Args:
rsi_win: default is 6
rsi_win int: default is 6
"""
self.title = title
self.bars = bars
Expand Down

0 comments on commit a47b96e

Please sign in to comment.