Merge branch 'master' of https://github.com/fasiondog/hikyuu into analysis

This commit is contained in:
fasiondog 2023-10-12 00:32:57 +08:00
commit 280747a456
9 changed files with 168 additions and 62 deletions

View File

@ -17,15 +17,35 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Cache packages
id: cache-xmake-ubuntu
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.xmake
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: xmake-io/github-action-setup-xmake@v1
- name: checkout
run: |
git clone https://github.com/fasiondog/hikyuu.git --recursive --depth 1
with:
xmake-version: branch@master
actions-cache-folder: '.xmake-cache'
- name: config
run: |
xmake f --feedback=n -y
- name: build
run: |
sudo apt-get install -y libsqlite3-dev
cd ./hikyuu
xmake f -y
xmake -b small-test
- name: test
run: |
xmake r small-test

View File

@ -22,14 +22,37 @@ jobs:
cancel-in-progress: true
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4
- name: Cache xmake aarch64 packages
id: cache-xmake-ubuntu-aarch64
uses: actions/cache@v3
env:
cache-name: cache-ubuntu-aarch64-modules
with:
path: |
~/.xmake
./${{ matrix.cross }}-cross.linux
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: xmake-io/github-action-setup-xmake@v1
with:
xmake-version: branch@master
actions-cache-folder: '.xmake-cache'
- name: Installation musl
run: |
wget https://github.com/xmake-mirror/musl.cc/releases/download/20210202/${{ matrix.cross }}-cross.linux.tgz
tar -xvf ${{ matrix.cross }}-cross.linux.tgz
- name: build
- name: configure
run: |
xmake f -p cross -a aarch64 --sdk=`pwd`/${{ matrix.cross }}-cross -y
- name: build
run: |
xmake -b hikyuu

View File

@ -17,14 +17,30 @@ jobs:
os: [ubuntu-latest]
steps:
- uses: actions/checkout@v4
- name: Cache packages
id: cache-xmake-ubuntu
uses: actions/cache@v3
env:
cache-name: cache-node-modules
with:
path: ~/.xmake
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: xmake-io/github-action-setup-xmake@v1
- name: checkout
run: |
git clone https://github.com/fasiondog/hikyuu.git --recursive --depth 1
with:
xmake-version: branch@master
actions-cache-folder: '.xmake-cache'
- name: configure
run: |
xmake f -y
- name: build
run: |
sudo apt-get install -y libsqlite3-dev
cd ./hikyuu
xmake f -y
xmake -b core

View File

@ -22,15 +22,37 @@ jobs:
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Cache windows packages
id: cache-xmake-windows
uses: actions/cache@v3
env:
cache-name: cache-windows-modules
with:
path: /Users/%USERNAME/.xmake
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: xmake-io/github-action-setup-xmake@v1
- name: checkout
run: |
git clone https://github.com/fasiondog/hikyuu.git --recursive --depth 1
with:
xmake-version: branch@master
actions-cache-folder: '.xmake-cache'
- name: configure
shell: cmd
run: |
xmake f --feedback=n -y
- name: build
shell: cmd
run: |
cd hikyuu
xmake f -y
xmake -b small-test
- name: test
shell: cmd
run: |
xmake r small-test

View File

@ -22,14 +22,32 @@ jobs:
cancel-in-progress: true
steps:
- uses: actions/checkout@v4
- name: Cache windows packages
id: cache-xmake-windows
uses: actions/cache@v3
env:
cache-name: cache-windows-modules
with:
path: /Users/%USERNAME/.xmake
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
${{ runner.os }}-build-
${{ runner.os }}-
- uses: xmake-io/github-action-setup-xmake@v1
- name: checkout
run: |
git clone https://github.com/fasiondog/hikyuu.git --recursive --depth 1
with:
xmake-version: branch@master
actions-cache-folder: '.xmake-cache'
- name: configure
shell: cmd
run: |
xmake f -y --pyver=3.11
- name: build
shell: cmd
run: |
cd hikyuu
xmake f -y --pyver=3.11
xmake -b core
xmake -b core

View File

@ -0,0 +1,22 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# We recommend specifying your dependencies to enable reproducible builds:
# https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt

View File

@ -108,7 +108,7 @@ todo_include_todos = False
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'sphinx_rtd_theme'
html_theme = 'sphinxdoc'
#可选alabaster, sphinx_rtd_theme, classic, sphinxdoc, scrolls, agogo, traditional, nature, haiku, pyramid, bizstyle
#http://www.sphinx-doc.org/en/stable/theming.html#using-a-theme

View File

@ -25,20 +25,9 @@ C++测试工程参考:`<http://fasiondog.cn/hikyuu/test_doc/index.html>`_
2、安装构建工具 xmake
^^^^^^^^^^^^^^^^^^^^^^^^^^^
xmake >= 2.2.2,网址:`<https://github.com/xmake-io/xmake>`_
xmake >= 2.8.2,网址:`<https://github.com/xmake-io/xmake>`_
Windows下从 xmake github 页面中的“release”进入直接下载相应的 exe 安装包安装即可:
.. figure:: _static/dev-001.jpg
Linux、macOSX 执行以下指令安装:
.. code-block:: shell
git clone --branch=dev https://github.com/tboox/xmake.git tboox/xmake --depth 1
cd ./tboox/xmake
./scripts/get.sh __local__
参见https://xmake.io/#/zh-cn/guide/installation `<https://xmake.io/#/zh-cn/guide/installation>`
3、克隆 Hikyuu 源码
@ -48,7 +37,7 @@ Linux、macOSX 执行以下指令安装:
.. code-block:: shell
git clone https://github.com/fasiondog/hikyuu.git --recursive --depth 1
git clone https://github.com/fasiondog/hikyuu.git --recursive
4、Linux下安装依赖软件包

View File

@ -112,7 +112,7 @@ void export_TradeManager() {
:rtype: int)")
//.def("getShortStockNumber", &TradeManager::getShortStockNumber)
.def("get_short_stock_num", &TradeManagerBase::getShortStockNumber)
.def("get_hold_num", &TradeManagerBase::getHoldNumber, R"(get_hold_num(self, datetime, stock)
@ -122,7 +122,7 @@ void export_TradeManager() {
:param Stock stock:
:rtype: int)")
//.def("getShortHoldNumber", &TradeManager::getShortHoldNumber)
.def("get_short_hold_num", &TradeManagerBase::getShortHoldNumber)
.def("get_trade_list", _getTradeList_1)
.def("get_trade_list", _getTradeList_2, R"(get_trade_list(self[, start, end])
@ -175,10 +175,10 @@ void export_TradeManager() {
:param float num:
:rtype: CostRecord)")
//.def("getBorrowCashCost", &TradeManager::getBorrowCashCost)
//.def("getReturnCashCost", &TradeManager::getReturnCashCost)
//.def("getBorrowStockCost", &TradeManager::getBorrowStockCost)
//.def("getReturnStockCost", &TradeManager::getReturnStockCost)
.def("get_borrow_cash_cost", &TradeManagerBase::getBorrowCashCost)
.def("get_return_cash_cost", &TradeManagerBase::getReturnCashCost)
.def("get_borrow_stock_cost", &TradeManagerBase::getBorrowStockCost)
.def("get_return_stock_cost", &TradeManagerBase::getReturnStockCost)
.def("cash", &TradeManagerBase::cash, (arg("datetime"), arg("ktype") = KQuery::DAY),
R"(cash(self, datetime[, ktype=Query.KType.DAY])
@ -237,12 +237,12 @@ void export_TradeManager() {
:param float cash:
:rtype: TradeRecord)")
//.def("checkinStock", &TradeManager::checkinStock)
//.def("checkoutStock", &TradeManager::checkoutStock)
//.def("borrowCash", &TradeManager::borrowCash)
//.def("returnCash", &TradeManager::returnCash)
//.def("borrowStock", &TradeManager::borrowStock)
//.def("returnStock", &TradeManager::returnStock)
.def("checkin_stock", &TradeManagerBase::checkinStock)
.def("checkout_stock", &TradeManagerBase::checkoutStock)
.def("borrow_cash", &TradeManagerBase::borrowCash)
.def("return_cash", &TradeManagerBase::returnCash)
.def("borrow_stock", &TradeManagerBase::borrowStock)
.def("return_stock", &TradeManagerBase::returnStock)
.def(
"buy", &TradeManagerBase::buy,
@ -262,9 +262,6 @@ void export_TradeManager() {
:param SystemPart part:
:rtype: TradeRecord)")
// buy_overload(args("datetime", "stock", "realPrice",
//"num", "stoploss", "goalPrice", "planPrice","part")))
.def(
"sell", &TradeManagerBase::sell,
(arg("datetime"), arg("stock"), arg("real_price"), arg("num") = MAX_DOUBLE,
@ -283,10 +280,9 @@ void export_TradeManager() {
:param float plan_price:
:param SystemPart part:
:rtype: TradeRecord)")
// sell_overload(args("datetime", "stock", "realPrice", "num", "stoploss", "goalPrice",
// "planPrice", "part")))
//.def("buyShort", &TradeManager::buyShort, buyShort_overload())
//.def("sellShort", &TradeManager::sellShort, sellShort_overload())
.def("buy_short", &TradeManagerBase::buyShort)
.def("sell_short", &TradeManagerBase::sellShort)
.def("add_trade_record", &TradeManagerBase::addTradeRecord, R"(add_trade_record(self, tr)