From 53fdaaeef7b5afe4c831452f9f1c5572f743c94c Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 17:02:24 +0800 Subject: [PATCH 01/13] update developer.rst --- docs/source/developer.rst | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/docs/source/developer.rst b/docs/source/developer.rst index d6a499b4..32ea162b 100644 --- a/docs/source/developer.rst +++ b/docs/source/developer.rst @@ -25,20 +25,9 @@ C++测试工程参考:``_ 2、安装构建工具 xmake ^^^^^^^^^^^^^^^^^^^^^^^^^^^ -xmake >= 2.2.2,网址:``_ +xmake >= 2.8.2,网址:``_ -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 `` 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下安装依赖软件包 From 8d9b9a769f7d32f1668f7a7db183a6e11d74413d Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 17:08:01 +0800 Subject: [PATCH 02/13] update for readthedocs --- docs/source/.readthedocs.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 docs/source/.readthedocs.yml diff --git a/docs/source/.readthedocs.yml b/docs/source/.readthedocs.yml new file mode 100644 index 00000000..8bbcb97a --- /dev/null +++ b/docs/source/.readthedocs.yml @@ -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 \ No newline at end of file From 4f145c914b2566008d0421179aa56b0a62258c42 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 17:11:32 +0800 Subject: [PATCH 03/13] fixed readthedocs --- docs/source/{.readthedocs.yml => .readthedocs.yaml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/source/{.readthedocs.yml => .readthedocs.yaml} (100%) diff --git a/docs/source/.readthedocs.yml b/docs/source/.readthedocs.yaml similarity index 100% rename from docs/source/.readthedocs.yml rename to docs/source/.readthedocs.yaml From 5ac53aee9087e7a9410d0c8dbef57294945cd765 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 17:17:18 +0800 Subject: [PATCH 04/13] update shphix conf.py --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/conf.py b/docs/source/conf.py index 47442093..88cb0f89 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 = 'classic' #可选: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 From c6c53ef51c9822b4a4d0d3e9a26bda721c4bc4bc Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 18:06:12 +0800 Subject: [PATCH 05/13] update readthedocs --- docs/source/.readthedocs.yaml | 2 ++ docs/source/conf.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/docs/source/.readthedocs.yaml b/docs/source/.readthedocs.yaml index 8bbcb97a..1941527c 100644 --- a/docs/source/.readthedocs.yaml +++ b/docs/source/.readthedocs.yaml @@ -10,6 +10,8 @@ build: os: ubuntu-22.04 tools: python: "3.11" + commands: + pip install sphinx_rtd_theme # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/docs/source/conf.py b/docs/source/conf.py index 88cb0f89..47442093 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 = 'classic' +html_theme = 'sphinx_rtd_theme' #可选: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 From fa2f9f90e646fd3210152173880bca15954c1d4f Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 18:11:11 +0800 Subject: [PATCH 06/13] fixed readthedocs --- docs/source/.readthedocs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/source/.readthedocs.yaml b/docs/source/.readthedocs.yaml index 1941527c..7c8897ca 100644 --- a/docs/source/.readthedocs.yaml +++ b/docs/source/.readthedocs.yaml @@ -11,7 +11,7 @@ build: tools: python: "3.11" commands: - pip install sphinx_rtd_theme + - pip install sphinx_rtd_theme # Build documentation in the docs/ directory with Sphinx sphinx: From 90e11297ffdbb8b88b6cce12453a9edd955d0b82 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 18:15:13 +0800 Subject: [PATCH 07/13] update readthedocs --- docs/source/.readthedocs.yaml | 2 -- docs/source/conf.py | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/source/.readthedocs.yaml b/docs/source/.readthedocs.yaml index 7c8897ca..8bbcb97a 100644 --- a/docs/source/.readthedocs.yaml +++ b/docs/source/.readthedocs.yaml @@ -10,8 +10,6 @@ build: os: ubuntu-22.04 tools: python: "3.11" - commands: - - pip install sphinx_rtd_theme # Build documentation in the docs/ directory with Sphinx sphinx: diff --git a/docs/source/conf.py b/docs/source/conf.py index 47442093..51b0b489 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -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 From 78c6a3d90d56dbff5557807f66cc2816f31ac4b4 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 21:01:28 +0800 Subject: [PATCH 08/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=20github=20actions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ubuntu.yml | 34 +++++++++++++++++++++++++++------- .github/workflows/windows.yml | 2 +- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index c0190115..2f855cb9 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -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 + \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 549ad08e..46554b44 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -31,6 +31,6 @@ jobs: shell: cmd run: | cd hikyuu - xmake f -y + xmake f --feedback=n -y xmake -b small-test xmake r small-test From f9df7440903db53d75f4acb3e3acec0f27d9dd29 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 22:12:50 +0800 Subject: [PATCH 09/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=20github=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ubuntu_aarch64.yml | 21 +++++++++++++++++++-- .github/workflows/ubuntu_python.yml | 26 +++++++++++++++++++------- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ubuntu_aarch64.yml b/.github/workflows/ubuntu_aarch64.yml index e24268bb..99a76ea3 100644 --- a/.github/workflows/ubuntu_aarch64.yml +++ b/.github/workflows/ubuntu_aarch64.yml @@ -22,14 +22,31 @@ 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 + 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: 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 \ No newline at end of file diff --git a/.github/workflows/ubuntu_python.yml b/.github/workflows/ubuntu_python.yml index e40c669a..a5f86d59 100644 --- a/.github/workflows/ubuntu_python.yml +++ b/.github/workflows/ubuntu_python.yml @@ -17,14 +17,26 @@ jobs: os: [ubuntu-latest] steps: + - uses: actions/checkout@v4 - uses: xmake-io/github-action-setup-xmake@v1 - - name: checkout - run: | - git clone https://github.com/fasiondog/hikyuu.git --recursive --depth 1 - + + - 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 }}- + + - name: configure + run: | + xmake f -y + - name: build run: | - sudo apt-get install -y libsqlite3-dev - cd ./hikyuu - xmake f -y xmake -b core From 85b23c6712681d622d4ee1e17cf558c64e11a505 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 22:38:40 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E4=BC=98=E5=8C=96=20github=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ubuntu_aarch64.yml | 8 ++++++- .github/workflows/ubuntu_python.yml | 6 +++++- .github/workflows/windows.yml | 32 +++++++++++++++++++++++----- .github/workflows/windows_python.yml | 30 ++++++++++++++++++++------ 4 files changed, 63 insertions(+), 13 deletions(-) diff --git a/.github/workflows/ubuntu_aarch64.yml b/.github/workflows/ubuntu_aarch64.yml index 99a76ea3..dca64882 100644 --- a/.github/workflows/ubuntu_aarch64.yml +++ b/.github/workflows/ubuntu_aarch64.yml @@ -30,7 +30,9 @@ jobs: env: cache-name: cache-ubuntu-aarch64-modules with: - path: ~/.xmake + 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 }}- @@ -38,6 +40,10 @@ jobs: ${{ 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 diff --git a/.github/workflows/ubuntu_python.yml b/.github/workflows/ubuntu_python.yml index a5f86d59..2eb4e869 100644 --- a/.github/workflows/ubuntu_python.yml +++ b/.github/workflows/ubuntu_python.yml @@ -18,7 +18,6 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: xmake-io/github-action-setup-xmake@v1 - name: Cache packages id: cache-xmake-ubuntu @@ -33,6 +32,11 @@ jobs: ${{ runner.os }}-build- ${{ runner.os }}- + - uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: branch@master + actions-cache-folder: '.xmake-cache' + - name: configure run: | xmake f -y diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 46554b44..ccd929b6 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -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: ~/.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: build shell: cmd run: | - cd hikyuu xmake f --feedback=n -y + + - name: build + shell: cmd + run: | xmake -b small-test + + - name: test + shell: cmd + run: | xmake r small-test diff --git a/.github/workflows/windows_python.yml b/.github/workflows/windows_python.yml index 83293e04..d66b9409 100644 --- a/.github/workflows/windows_python.yml +++ b/.github/workflows/windows_python.yml @@ -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: ~/.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 \ No newline at end of file From e302b5f6d1e1ce0f89983fa09385f6a2ce37133c Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 22:42:07 +0800 Subject: [PATCH 11/13] update github action --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ccd929b6..5ace2927 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -42,7 +42,7 @@ jobs: xmake-version: branch@master actions-cache-folder: '.xmake-cache' - - name: build + - name: configure shell: cmd run: | xmake f --feedback=n -y From b19432dccde2e8bc7e230a7c2012cfb270820a00 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Tue, 10 Oct 2023 23:47:03 +0800 Subject: [PATCH 12/13] update for github action --- .github/workflows/windows.yml | 2 +- .github/workflows/windows_python.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 5ace2927..ad4b3220 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -30,7 +30,7 @@ jobs: env: cache-name: cache-windows-modules with: - path: ~/.xmake + path: /Users/%USERNAME/.xmake key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- diff --git a/.github/workflows/windows_python.yml b/.github/workflows/windows_python.yml index d66b9409..035f3aea 100644 --- a/.github/workflows/windows_python.yml +++ b/.github/workflows/windows_python.yml @@ -30,7 +30,7 @@ jobs: env: cache-name: cache-windows-modules with: - path: ~/.xmake + path: /Users/%USERNAME/.xmake key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- From 02bdfaf9bce5627f3dc9687f35814d98c0ee4a80 Mon Sep 17 00:00:00 2001 From: fasiondog Date: Thu, 12 Oct 2023 00:02:29 +0800 Subject: [PATCH 13/13] update _TradeManager.cpp --- hikyuu_pywrap/trade_manage/_TradeManager.cpp | 34 +++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/hikyuu_pywrap/trade_manage/_TradeManager.cpp b/hikyuu_pywrap/trade_manage/_TradeManager.cpp index 07fe5993..97aadb1d 100644 --- a/hikyuu_pywrap/trade_manage/_TradeManager.cpp +++ b/hikyuu_pywrap/trade_manage/_TradeManager.cpp @@ -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)