Skip to content

Commit

Permalink
fix order_type in orderStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
letianzj committed Jun 15, 2024
1 parent 1dd44b6 commit 766f0f7
Show file tree
Hide file tree
Showing 8 changed files with 93 additions and 85 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,14 @@ jobs:
pip install PyQt5 >= 5.15.10
pip install QDarkStyle >= 2.8
- name: Check code formatting with black
run: |
poetry run isort --check .
poetry run black --check .
- name: Analysing the code with pylint
run: |
poetry run pylint $(git ls-files '*.py')
- name: Check code formatting with black
run: poetry run black --check .

- name: Run tests
run: poetry run pytest
36 changes: 36 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Publish to PyPI

on:
push:
tags:
- 'v*' # This triggers the workflow on new tags starting with "v"

jobs:
publish:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12' # Specify your Python version

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build twine
- name: Build package
run: python -m build

- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: python -m twine upload dist/*

- name: Clean up
run: rm -rf dist build *.egg-info
Empty file added changelog.md
Empty file.
4 changes: 2 additions & 2 deletions examples/config_live.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ strategy:
lookback_5sec: 50
lookback_15sec: 20
symbols:
- ESM1 FUT GLOBEX
- EUM4 FUT GLOBEX
#---------- Strategy and params control -----------#
# DualThrustStrategy:
# active: false
Expand Down Expand Up @@ -60,7 +60,7 @@ strategy:
tick_trigger_threshold: 6000
single_trade_limit: 3
symbols:
- ESM1 FUT GLOBEX
- SPY STK SMART
total_active_limit: 2
total_cancel_limit: 5
total_loss_limit: 5000
Expand Down
12 changes: 5 additions & 7 deletions examples/download_historical_data_from_ib.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def run(self) -> None:
# RTH stock 9:30~16:00; FUT 9:30~17:00, ES halt 16:15~16:30
# 7.5h x 2 = 15 requests = 15*15 ~ 4min
symbols = [
"ESU0 FUT GLOBEX", # 9:30 a.m. ET on the 3rd Friday of the contract month; 15:14:30 – 15:15:00 CT; final 9:30am opening prices
# "ESU4 FUT GLOBEX", # 9:30 a.m. ET on the 3rd Friday of the contract month; 15:14:30 – 15:15:00 CT; final 9:30am opening prices
# 'NQU0 FUT GLOBEX', # 9:30 a.m. ET on the 3rd Friday of the contract month
# 'CLU0 FUT NYNEX', # 3 business day prior to the 25th calendar day of the month prior to the contract month, if not business day; active -2D; 4:28:00 to 14:30:00 ET; 14:00:00 and 14:30:00 ET
# 'CLV0 FUT NYNEX',
Expand All @@ -72,7 +72,7 @@ def run(self) -> None:
# 'RBV0 FUT NYMEX',
# 'NGU0 FUT NYMEX', # 3rd last business days of the month prior to the contract month; active -2D. 14:28:00 to 14:30:00 ET; 14:00:00 and 14:30:00 ET
# 'NGV0 FUT NYMEX',
# # 'SPY STK SMART',
"SPY STK SMART",
# 'QQQ STK SMART',
# 'XLE STK SMART',
# 'XLF STK SMART',
Expand Down Expand Up @@ -103,9 +103,7 @@ def run(self) -> None:
# daily combine and remove duplicates
dfd = self.df.combine_first(dfd)
# ready for the next 30min
self.df = pd.DataFrame(
columns=["Open", "High", "Low", "Close", "Volume"]
)
self.df = pd.DataFrame(columns=["Open", "High", "Low", "Close", "Volume"])

dfd.sort_index(inplace=True)
dict_all[sym] = dfd
Expand All @@ -129,10 +127,10 @@ def run(self) -> None:

if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Historical Downloader")
parser.add_argument("--date", help="yyyymmdd")
parser.add_argument("--date", help="yyyymmdd", required=True)
parser.add_argument(
"--path",
default="d:/workspace/quantresearch/data/tick/",
default="c::/workspace/data/tick/",
help="hist data folder",
)

Expand Down
1 change: 1 addition & 0 deletions examples/instrument_meta.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# default: multiplier: 1
# margin: 100%

ES:
Type: FUT
Root: ES
Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ build-backend = "setuptools.build_meta"

[project]
name = "quanttrader"
version = "0.1.0"
description = "quant trader python"
version = "0.6.0"
description = "quanttrader backtest and live trading library"
readme = "README.md"
authors = [
{name = "Letian Wang", email = "[email protected]"}
Expand Down Expand Up @@ -43,7 +43,7 @@ package-dir = {"" = "src"}

[tool.poetry]
name = "quanttrader"
version = "0.1.0"
version = "0.6.0"
description = "quant trader python"
authors = ["Letian Wang <[email protected]>"]

Expand Down
Loading

0 comments on commit 766f0f7

Please sign in to comment.