Skip to content

Commit 1dededa

Browse files
bingyaoBingyao Liu
and
Bingyao Liu
authored
Improve the style of documentation (#1132)
This commit improves the documentation (rst files) only in the following three ways: * Aligned section headers with their underline/overline punctuation characters * Deleted all trailling whitespaces in rst files * Deleted a few trailling newlines at the end of the rst files Co-authored-by: Bingyao Liu <[email protected]>
1 parent e62684e commit 1dededa

29 files changed

+400
-411
lines changed

CHANGES.rst

+28-28
Original file line numberDiff line numberDiff line change
@@ -1,88 +1,88 @@
11
Changelog
2-
====================
2+
=========
33
Here you can see the full list of changes between each QLib release.
44

55
Version 0.1.0
6-
--------------------
6+
-------------
77
This is the initial release of QLib library.
88

99
Version 0.1.1
10-
--------------------
10+
-------------
1111
Performance optimize. Add more features and operators.
1212

1313
Version 0.1.2
14-
--------------------
15-
- Support operator syntax. Now ``High() - Low()`` is equivalent to ``Sub(High(), Low())``.
14+
-------------
15+
- Support operator syntax. Now ``High() - Low()`` is equivalent to ``Sub(High(), Low())``.
1616
- Add more technical indicators.
1717

1818
Version 0.1.3
19-
--------------------
19+
-------------
2020
Bug fix and add instruments filtering mechanism.
2121

2222
Version 0.2.0
23-
--------------------
23+
-------------
2424
- Redesign ``LocalProvider`` database format for performance improvement.
2525
- Support load features as string fields.
2626
- Add scripts for database construction.
2727
- More operators and technical indicators.
2828

2929
Version 0.2.1
30-
--------------------
30+
-------------
3131
- Support registering user-defined ``Provider``.
3232
- Support use operators in string format, e.g. ``['Ref($close, 1)']`` is valid field format.
3333
- Support dynamic fields in ``$some_field`` format. And existing fields like ``Close()`` may be deprecated in the future.
3434

3535
Version 0.2.2
36-
--------------------
36+
-------------
3737
- Add ``disk_cache`` for reusing features (enabled by default).
3838
- Add ``qlib.contrib`` for experimental model construction and evaluation.
3939

4040

4141
Version 0.2.3
42-
--------------------
42+
-------------
4343
- Add ``backtest`` module
4444
- Decoupling the Strategy, Account, Position, Exchange from the backtest module
4545

4646
Version 0.2.4
47-
--------------------
47+
-------------
4848
- Add ``profit attribution`` module
4949
- Add ``rick_control`` and ``cost_control`` strategies
50-
50+
5151
Version 0.3.0
52-
--------------------
52+
-------------
5353
- Add ``estimator`` module
5454

5555
Version 0.3.1
56-
--------------------
56+
-------------
5757
- Add ``filter`` module
5858

5959
Version 0.3.2
60-
--------------------
60+
-------------
6161
- Add real price trading, if the ``factor`` field in the data set is incomplete, use ``adj_price`` trading
6262
- Refactor ``handler`` ``launcher`` ``trainer`` code
6363
- Support ``backtest`` configuration parameters in the configuration file
6464
- Fix bug in position ``amount`` is 0
6565
- Fix bug of ``filter`` module
6666

6767
Version 0.3.3
68-
-------------------
68+
-------------
6969
- Fix bug of ``filter`` module
7070

7171
Version 0.3.4
72-
--------------------
72+
-------------
7373
- Support for ``finetune model``
7474
- Refactor ``fetcher`` code
7575

7676
Version 0.3.5
77-
--------------------
77+
-------------
7878
- Support multi-label training, you can provide multiple label in ``handler``. (But LightGBM doesn't support due to the algorithm itself)
7979
- Refactor ``handler`` code, dataset.py is no longer used, and you can deploy your own labels and features in ``feature_label_config``
8080
- Handler only offer DataFrame. Also, ``trainer`` and model.py only receive DataFrame
8181
- Change ``split_rolling_data``, we roll the data on market calendar now, not on normal date
8282
- Move some date config from ``handler`` to ``trainer``
8383

8484
Version 0.4.0
85-
--------------------
85+
-------------
8686
- Add `data` package that holds all data-related codes
8787
- Reform the data provider structure
8888
- Create a server for data centralized management `qlib-server<https://amc-msra.visualstudio.com/trading-algo/_git/qlib-server>`_
@@ -100,7 +100,7 @@ Version 0.4.0
100100

101101

102102
Version 0.4.1
103-
--------------------
103+
-------------
104104
- Add support Windows
105105
- Fix ``instruments`` type bug
106106
- Fix ``features`` is empty bug(It will cause failure in updating)
@@ -112,19 +112,19 @@ Version 0.4.1
112112

113113

114114
Version 0.4.2
115-
--------------------
115+
-------------
116116
- Refactor DataHandler
117117
- Add ``Alpha360`` DataHandler
118118

119119

120120
Version 0.4.3
121-
--------------------
121+
-------------
122122
- Implementing Online Inference and Trading Framework
123123
- Refactoring The interfaces of backtest and strategy module.
124124

125125

126126
Version 0.4.4
127-
--------------------
127+
-------------
128128
- Optimize cache generation performance
129129
- Add report module
130130
- Fix bug when using ``ServerDatasetCache`` offline.
@@ -138,30 +138,30 @@ Version 0.4.4
138138

139139

140140
Version 0.4.5
141-
--------------------
141+
-------------
142142
- Add multi-kernel implementation for both client and server.
143143
- Support a new way to load data from client which skips dataset cache.
144144
- Change the default dataset method from single kernel implementation to multi kernel implementation.
145145
- Accelerate the high frequency data reading by optimizing the relative modules.
146146
- Support a new method to write config file by using dict.
147147

148148
Version 0.4.6
149-
--------------------
149+
-------------
150150
- Some bugs are fixed
151151
- The default config in `Version 0.4.5` is not friendly to daily frequency data.
152152
- Backtest error in TopkWeightStrategy when `WithInteract=True`.
153153

154154

155155
Version 0.5.0
156-
--------------------
156+
-------------
157157
- First opensource version
158158
- Refine the docs, code
159159
- Add baselines
160160
- public data crawler
161161

162162

163163
Version 0.8.0
164-
--------------------
164+
-------------
165165
- The backtest is greatly refactored.
166166
- Nested decision execution framework is supported
167167
- There are lots of changes for daily trading, it is hard to list all of them. But a few important changes could be noticed
@@ -175,5 +175,5 @@ Version 0.8.0
175175

176176

177177
Other Versions
178-
----------------------------------
178+
--------------
179179
Please refer to `Github release Notes <https://github.com/microsoft/qlib/releases>`_

docs/FAQ/FAQ.rst

+6-6
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Qlib FAQ
33
############
44

55
Qlib Frequently Asked Questions
6-
================================
6+
===============================
77
.. contents::
88
:depth: 1
99
:local:
@@ -13,7 +13,7 @@ Qlib Frequently Asked Questions
1313

1414

1515
1. RuntimeError: An attempt has been made to start a new process before the current process has finished its bootstrapping phase...
16-
------------------------------------------------------------------------------------------------------------------------------------
16+
-----------------------------------------------------------------------------------------------------------------------------------
1717

1818
.. code-block:: console
1919
@@ -52,7 +52,7 @@ This is caused by the limitation of multiprocessing under windows OS. Please ref
5252
5353
5454
2. qlib.data.cache.QlibCacheException: It sees the key(...) of the redis lock has existed in your redis db now.
55-
-----------------------------------------------------------------------------------------------------------------
55+
---------------------------------------------------------------------------------------------------------------
5656

5757
It sees the key of the redis lock has existed in your redis db now. You can use the following command to clear your redis keys and rerun your commands
5858

@@ -72,7 +72,7 @@ If the issue is not resolved, use ``keys *`` to find if multiple keys exist. If
7272
Also, feel free to post a new issue in our GitHub repository. We always check each issue carefully and try our best to solve them.
7373

7474
3. ModuleNotFoundError: No module named 'qlib.data._libs.rolling'
75-
------------------------------------------------------------------------------------------------------------------------------------
75+
-----------------------------------------------------------------
7676

7777
.. code-block:: python
7878
@@ -101,7 +101,7 @@ Also, feel free to post a new issue in our GitHub repository. We always check ea
101101
102102
103103
4. BadNamespaceError: / is not a connected namespace
104-
------------------------------------------------------------------------------------------------------------------------------------
104+
----------------------------------------------------
105105
106106
.. code-block:: python
107107
@@ -125,7 +125,7 @@ Also, feel free to post a new issue in our GitHub repository. We always check ea
125125
126126
127127
5. TypeError: send() got an unexpected keyword argument 'binary'
128-
------------------------------------------------------------------------------------------------------------------------------------
128+
----------------------------------------------------------------
129129
130130
.. code-block:: python
131131

docs/advanced/PIT.rst

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
.. _pit:
22

3-
===========================
3+
============================
44
(P)oint-(I)n-(T)ime Database
5-
===========================
5+
============================
66
.. currentmodule:: qlib
77

88

99
Introduction
1010
------------
11-
Point-in-time data is a very important consideration when performing any sort of historical market analysis.
11+
Point-in-time data is a very important consideration when performing any sort of historical market analysis.
1212

1313
For example, let’s say we are backtesting a trading strategy and we are using the past five years of historical data as our input.
1414
Our model is assumed to trade once a day, at the market close, and we’ll say we are calculating the trading signal for 1 January 2020 in our backtest. At that point, we should only have data for 1 January 2020, 31 December 2019, 30 December 2019 etc.

docs/advanced/alpha.rst

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
.. _alpha:
22

3-
===========================
4-
Building Formulaic Alphas
5-
===========================
3+
=========================
4+
Building Formulaic Alphas
5+
=========================
66
.. currentmodule:: qlib
77

88
Introduction
9-
===================
9+
============
1010

1111
In quantitative trading practice, designing novel factors that can explain and predict future asset returns are of vital importance to the profitability of a strategy. Such factors are usually called alpha factors, or alphas in short.
1212

@@ -15,28 +15,28 @@ A formulaic alpha, as the name suggests, is a kind of alpha that can be presente
1515

1616

1717
Building Formulaic Alphas in ``Qlib``
18-
======================================
18+
=====================================
1919

2020
In ``Qlib``, users can easily build formulaic alphas.
2121

2222
Example
23-
-----------------
23+
-------
2424

2525
`MACD`, short for moving average convergence/divergence, is a formulaic alpha used in technical analysis of stock prices. It is designed to reveal changes in the strength, direction, momentum, and duration of a trend in a stock's price.
2626

2727
`MACD` can be presented as the following formula:
2828

29-
.. math::
29+
.. math::
3030
3131
MACD = 2\times (DIF-DEA)
3232
3333
.. note::
3434

3535
`DIF` means Differential value, which is 12-period EMA minus 26-period EMA.
36-
36+
3737
.. math::
3838
39-
DIF = \frac{EMA(CLOSE, 12) - EMA(CLOSE, 26)}{CLOSE}
39+
DIF = \frac{EMA(CLOSE, 12) - EMA(CLOSE, 26)}{CLOSE}
4040
4141
`DEA`means a 9-period EMA of the DIF.
4242

@@ -65,7 +65,7 @@ Users can use ``Data Handler`` to build formulaic alphas `MACD` in qlib:
6565
>> print(df)
6666
feature label
6767
MACD LABEL
68-
datetime instrument
68+
datetime instrument
6969
2010-01-04 SH600000 -0.011547 -0.019672
7070
SH600004 0.002745 -0.014721
7171
SH600006 0.010133 0.002911
@@ -79,7 +79,7 @@ Users can use ``Data Handler`` to build formulaic alphas `MACD` in qlib:
7979
SZ300315 -0.030557 0.012455
8080
8181
Reference
82-
===========
82+
=========
8383

8484
To learn more about ``Data Loader``, please refer to `Data Loader <../component/data.html#data-loader>`_
8585

docs/advanced/serial.rst

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
.. _serial:
22

3-
=================================
3+
=============
44
Serialization
5-
=================================
5+
=============
66
.. currentmodule:: qlib
77

88
Introduction
9-
===================
10-
``Qlib`` supports dumping the state of ``DataHandler``, ``DataSet``, ``Processor`` and ``Model``, etc. into a disk and reloading them.
9+
============
10+
``Qlib`` supports dumping the state of ``DataHandler``, ``DataSet``, ``Processor`` and ``Model``, etc. into a disk and reloading them.
1111

1212
Serializable Class
13-
========================
13+
==================
1414

15-
``Qlib`` provides a base class ``qlib.utils.serial.Serializable``, whose state can be dumped into or loaded from disk in `pickle` format.
15+
``Qlib`` provides a base class ``qlib.utils.serial.Serializable``, whose state can be dumped into or loaded from disk in `pickle` format.
1616
When users dump the state of a ``Serializable`` instance, the attributes of the instance whose name **does not** start with `_` will be saved on the disk.
1717
However, users can use ``config`` method or override ``default_dump_all`` attribute to prevent this feature.
1818

1919
Users can also override ``pickle_backend`` attribute to choose a pickle backend. The supported value is "pickle" (default and common) and "dill" (dump more things such as function, more information in `here <https://pypi.org/project/dill/>`_).
2020

2121
Example
22-
==========================
23-
``Qlib``'s serializable class includes ``DataHandler``, ``DataSet``, ``Processor`` and ``Model``, etc., which are subclass of ``qlib.utils.serial.Serializable``.
22+
=======
23+
``Qlib``'s serializable class includes ``DataHandler``, ``DataSet``, ``Processor`` and ``Model``, etc., which are subclass of ``qlib.utils.serial.Serializable``.
2424
Specifically, ``qlib.data.dataset.DatasetH`` is one of them. Users can serialize ``DatasetH`` as follows.
2525

2626
.. code-block:: Python
@@ -33,13 +33,13 @@ Specifically, ``qlib.data.dataset.DatasetH`` is one of them. Users can serialize
3333
dataset = pickle.load(file_dataset)
3434
3535
.. note::
36-
Only state of ``DatasetH`` should be saved on the disk, such as some `mean` and `variance` used for data normalization, etc.
36+
Only state of ``DatasetH`` should be saved on the disk, such as some `mean` and `variance` used for data normalization, etc.
3737

3838
After reloading the ``DatasetH``, users need to reinitialize it. It means that users can reset some states of ``DatasetH`` or ``QlibDataHandler`` such as `instruments`, `start_time`, `end_time` and `segments`, etc., and generate new data according to the states (data is not state and should not be saved on the disk).
3939

4040
A more detailed example is in this `link <https://github.com/microsoft/qlib/tree/main/examples/highfreq>`_.
4141

4242

4343
API
44-
===================
44+
===
4545
Please refer to `Serializable API <../reference/api.html#module-qlib.utils.serial.Serializable>`_.

0 commit comments

Comments
 (0)