PyAlgoEngine 0.4.0.post1__tar.gz → 0.4.0.post2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/PKG-INFO +3 -3
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/PyAlgoEngine.egg-info/PKG-INFO +3 -3
- pyalgoengine-0.4.0.post2/PyAlgoEngine.egg-info/requires.txt +5 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/__init__.py +1 -1
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/back_test/sim_match.py +6 -3
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/engine/trade_engine.py +9 -6
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/setup.py +2 -2
- pyalgoengine-0.4.0.post1/PyAlgoEngine.egg-info/requires.txt +0 -5
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/LICENSE +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/PyAlgoEngine.egg-info/SOURCES.txt +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/PyAlgoEngine.egg-info/dependency_links.txt +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/PyAlgoEngine.egg-info/top_level.txt +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/README.md +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/back_test/__init__.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/back_test/__main__.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/back_test/replay.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/engine/__init__.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/engine/algo_engine.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/engine/event_engine.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/engine/market_engine.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/monitor/__init__.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/monitor/advanced_data_interface.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/profile/__init__.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/profile/cn.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/strategie/__init__.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/strategie/strategy_engine.py +0 -0
- {pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyAlgoEngine
|
|
3
|
-
Version: 0.4.0.
|
|
3
|
+
Version: 0.4.0.post2
|
|
4
4
|
Summary: Basic algo engine
|
|
5
5
|
Home-page: https://github.com/BolunHan/PyAlgoEngine
|
|
6
6
|
Author: Bolun.Han
|
|
@@ -17,8 +17,8 @@ License-File: LICENSE
|
|
|
17
17
|
Requires-Dist: numpy
|
|
18
18
|
Requires-Dist: pandas
|
|
19
19
|
Requires-Dist: exchange_calendars
|
|
20
|
-
Requires-Dist: PyQuantKit>=0.3.
|
|
21
|
-
Requires-Dist: PyEventEngine>=0.3.0.
|
|
20
|
+
Requires-Dist: PyQuantKit>=0.3.1
|
|
21
|
+
Requires-Dist: PyEventEngine>=0.3.0.post4
|
|
22
22
|
|
|
23
23
|
# PyAlgoEngine
|
|
24
24
|
python algo trading engine
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: PyAlgoEngine
|
|
3
|
-
Version: 0.4.0.
|
|
3
|
+
Version: 0.4.0.post2
|
|
4
4
|
Summary: Basic algo engine
|
|
5
5
|
Home-page: https://github.com/BolunHan/PyAlgoEngine
|
|
6
6
|
Author: Bolun.Han
|
|
@@ -17,8 +17,8 @@ License-File: LICENSE
|
|
|
17
17
|
Requires-Dist: numpy
|
|
18
18
|
Requires-Dist: pandas
|
|
19
19
|
Requires-Dist: exchange_calendars
|
|
20
|
-
Requires-Dist: PyQuantKit>=0.3.
|
|
21
|
-
Requires-Dist: PyEventEngine>=0.3.0.
|
|
20
|
+
Requires-Dist: PyQuantKit>=0.3.1
|
|
21
|
+
Requires-Dist: PyEventEngine>=0.3.0.post4
|
|
22
22
|
|
|
23
23
|
# PyAlgoEngine
|
|
24
24
|
python algo trading engine
|
|
@@ -67,7 +67,10 @@ class SimMatch(object):
|
|
|
67
67
|
# raise ValueError(f'Invalid instruction {order}, instruction must have a LimitPrice')
|
|
68
68
|
|
|
69
69
|
order.set_order_state(order_state=OrderState.Placed, timestamp=self.timestamp)
|
|
70
|
-
|
|
70
|
+
|
|
71
|
+
if not self.instant_fill:
|
|
72
|
+
self.working[order.order_id] = order
|
|
73
|
+
|
|
71
74
|
self.on_order(order=order, **kwargs)
|
|
72
75
|
|
|
73
76
|
if self.instant_fill:
|
|
@@ -253,7 +256,7 @@ class SimMatch(object):
|
|
|
253
256
|
order_id=order.order_id,
|
|
254
257
|
price=match_price,
|
|
255
258
|
multiplier=order.multiplier,
|
|
256
|
-
fee=self.
|
|
259
|
+
fee=self.fee_rate * match_volume * match_price * order.multiplier
|
|
257
260
|
)
|
|
258
261
|
|
|
259
262
|
LOGGER.info(f'[{self.market_time:%Y-%m-%d %H:%M:%S}] Sim-filled {order.ticker} {order.side.name} {report.volume:,.2f} @ {report.price:.2f}')
|
|
@@ -280,7 +283,7 @@ class SimMatch(object):
|
|
|
280
283
|
self.cancel_order(order_id=order_id)
|
|
281
284
|
|
|
282
285
|
def clear(self):
|
|
283
|
-
self.
|
|
286
|
+
# self.fee_rate = 0.
|
|
284
287
|
self.working.clear()
|
|
285
288
|
self.history.clear()
|
|
286
289
|
self.timestamp = 0.
|
|
@@ -19,7 +19,6 @@ from . import LOGGER
|
|
|
19
19
|
from .algo_engine import ALGO_ENGINE, AlgoTemplate
|
|
20
20
|
from .market_engine import MarketDataService
|
|
21
21
|
|
|
22
|
-
|
|
23
22
|
__all__ = ['DirectMarketAccess', 'PositionManagementService', 'Balance', 'Inventory', 'RiskProfile']
|
|
24
23
|
|
|
25
24
|
|
|
@@ -156,20 +155,25 @@ class DirectMarketAccess(object, metaclass=abc.ABCMeta):
|
|
|
156
155
|
if not self.enabled:
|
|
157
156
|
break
|
|
158
157
|
|
|
159
|
-
def
|
|
158
|
+
def start(self):
|
|
160
159
|
if self.enabled:
|
|
161
160
|
LOGGER.error(f'{self} already started!')
|
|
162
161
|
|
|
163
162
|
self.enabled = True
|
|
164
|
-
|
|
163
|
+
|
|
164
|
+
if self.cool_down:
|
|
165
|
+
self.worker.start()
|
|
165
166
|
|
|
166
167
|
def shut_down(self):
|
|
167
168
|
if not self.enabled:
|
|
168
169
|
LOGGER.error(f'{self} already stopped!')
|
|
169
170
|
|
|
170
171
|
self.enabled = False
|
|
171
|
-
|
|
172
|
-
|
|
172
|
+
|
|
173
|
+
if self.cool_down:
|
|
174
|
+
self.lock.release()
|
|
175
|
+
self.worker = Thread(target=self._order_buffer)
|
|
176
|
+
LOGGER.info(f'Order buff shutting down!')
|
|
173
177
|
|
|
174
178
|
@property
|
|
175
179
|
def timestamp(self):
|
|
@@ -2021,4 +2025,3 @@ class RiskProfile(object):
|
|
|
2021
2025
|
info_dict['global'][key] = rules[key]
|
|
2022
2026
|
|
|
2023
2027
|
return pd.DataFrame(info_dict).T
|
|
2024
|
-
|
|
File without changes
|
|
File without changes
|
{pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/PyAlgoEngine.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/monitor/advanced_data_interface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyalgoengine-0.4.0.post1 → pyalgoengine-0.4.0.post2}/algo_engine/strategie/strategy_engine.py
RENAMED
|
File without changes
|
|
File without changes
|