Skip to content

Commit

Permalink
perf: 增加github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
zsrl committed Oct 30, 2023
1 parent e4118ac commit d844a96
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 4 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Python package
on:
push:
tags:
- "v*.*.*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Set up Python
uses: actions/setup-python@v2

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyyaml
pip install auto-changelog
- name: Build and publish to PyPI
uses: JRubics/poetry-publish@v1.13
with:
ignore_dev_requirements: "yes"
pypi_token: ${{ secrets.PYPI_TOKEN }}

- name: Changelog
uses: ardalanamini/auto-changelog@master
id : changelog

- name: Create Release
uses: softprops/action-gh-release@v1
env :
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
body : |
${{ steps.changelog.outputs.changelog }}
prerelease: ${{ steps.changelog.outputs.prerelease }}
10 changes: 6 additions & 4 deletions qmtbt/qmtstore.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,23 +63,25 @@ def __init__(self, mini_qmt_path, xtquant_path, account):
self.xtdata = xtdata
self.xttrader = xttrader
self.xttype = xttype
self.xt_trader = None

def connect(self):

session_id = int(random.randint(100000, 999999))
xt_trader = self.xttrader.XtQuantTrader(self.mini_qmt_path, session_id)

xt_trader.start()

connect_result = xt_trader.connect()
print(connect_result, 'connect_result')

if connect_result == 0:
print('连接成功')

self.stock_account = self.xttype.StockAccount(account)
self.stock_account = self.xttype.StockAccount(self.account)

xt_trader.subscribe(self.stock_account)
xt_trader.subscribe(self.stock_account)

self.xt_trader = xt_trader
self.xt_trader = xt_trader

def _auto_expand_array_columns(self, df: pd.DataFrame) -> pd.DataFrame:
"""
Expand Down

0 comments on commit d844a96

Please sign in to comment.