PyAlgoEngine 0.7.4__tar.gz → 0.7.5__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.7.4 → pyalgoengine-0.7.5}/PKG-INFO +1 -1
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/PyAlgoEngine.egg-info/PKG-INFO +1 -1
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/__init__.py +1 -1
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/__init__.py +5 -1
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/market_utils_nt.py +1 -1
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/market_utils_posix.py +6 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/trade_utils.py +4 -20
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/LICENSE +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/PyAlgoEngine.egg-info/SOURCES.txt +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/PyAlgoEngine.egg-info/dependency_links.txt +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/PyAlgoEngine.egg-info/requires.txt +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/PyAlgoEngine.egg-info/top_level.txt +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/README.md +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/apps/__init__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/apps/backtest/__init__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/apps/backtest/doc_server.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/apps/backtest/tester.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/apps/backtest/web_app.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/apps/bokeh_server.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/apps/demo/__init__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/apps/demo/test.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/backtest/__init__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/backtest/__main__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/backtest/metrics.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/backtest/replay.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/backtest/sim_match.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/console_utils.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/finance_decimal.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/market_buffer.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/market_utils.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/technical_analysis.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/base/telemetrics.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/engine/__init__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/engine/algo_engine.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/engine/event_engine.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/engine/market_engine.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/engine/trade_engine.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/monitor/__init__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/monitor/advanced_data_interface.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/profile/__init__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/profile/cn.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/strategy/__init__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/strategy/strategy_engine.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/utils/__init__.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/utils/commit_regularizer.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/algo_engine/utils/data_utils.py +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/setup.cfg +0 -0
- {pyalgoengine-0.7.4 → pyalgoengine-0.7.5}/setup.py +0 -0
|
@@ -9,7 +9,11 @@ def set_logger(logger: logging.Logger):
|
|
|
9
9
|
global LOGGER
|
|
10
10
|
LOGGER = logger
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
if os.name == 'nt':
|
|
13
|
+
market_utils_nt.LOGGER = logger.getChild('MarketUtils')
|
|
14
|
+
else:
|
|
15
|
+
market_utils_posix.LOGGER = logger.getChild('MarketUtils')
|
|
16
|
+
|
|
13
17
|
trade_utils.LOGGER = logger.getChild('TradeUtils')
|
|
14
18
|
technical_analysis.LOGGER = logger.getChild('TA')
|
|
15
19
|
console_utils.LOGGER = logger.getChild('Console')
|
|
@@ -2111,6 +2111,12 @@ class TickData(MarketData):
|
|
|
2111
2111
|
self._order_book = OrderBook(ticker=ticker, timestamp=timestamp, bid=bid, ask=ask)
|
|
2112
2112
|
buffer.order_book = self._order_book._buffer
|
|
2113
2113
|
|
|
2114
|
+
if hasattr(self, '_order_book'):
|
|
2115
|
+
buffer.bid_price = self._order_book.best_bid_price
|
|
2116
|
+
buffer.bid_volume = self._order_book.best_bid_volume
|
|
2117
|
+
buffer.ask_price = self._order_book.best_ask_price
|
|
2118
|
+
buffer.ask_volume = self._order_book.best_ask_volume
|
|
2119
|
+
|
|
2114
2120
|
def __repr__(self) -> str:
|
|
2115
2121
|
"""
|
|
2116
2122
|
Returns a string representation of the `TickData` instance.
|
|
@@ -1,36 +1,20 @@
|
|
|
1
1
|
import abc
|
|
2
2
|
import copy
|
|
3
3
|
import datetime
|
|
4
|
+
import enum
|
|
4
5
|
import json
|
|
5
6
|
import math
|
|
6
7
|
import time
|
|
7
8
|
import uuid
|
|
8
|
-
from enum import Enum
|
|
9
9
|
from typing import Self
|
|
10
10
|
|
|
11
|
-
from . import LOGGER, PROFILE
|
|
12
|
-
from .market_utils import TransactionSide, TransactionData
|
|
11
|
+
from . import LOGGER, PROFILE, TransactionSide, TransactionData, OrderType
|
|
13
12
|
|
|
14
13
|
LOGGER = LOGGER.getChild('TradeUtils')
|
|
15
14
|
__all__ = ['OrderState', 'OrderType', 'TradeInstruction', 'TradeReport']
|
|
16
15
|
|
|
17
16
|
|
|
18
|
-
class
|
|
19
|
-
UNKNOWN = -2
|
|
20
|
-
CancelOrder = -1
|
|
21
|
-
Manual = 0
|
|
22
|
-
LimitOrder = 1
|
|
23
|
-
LimitMarketMaking = 1.1
|
|
24
|
-
MarketOrder = 2
|
|
25
|
-
FOK = 2.1
|
|
26
|
-
FAK = 2.2
|
|
27
|
-
IOC = 2.3
|
|
28
|
-
|
|
29
|
-
def __hash__(self):
|
|
30
|
-
return self.value
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
class OrderState(Enum):
|
|
17
|
+
class OrderState(enum.IntEnum):
|
|
34
18
|
UNKNOWN = -3
|
|
35
19
|
Rejected = -2 # order rejected
|
|
36
20
|
Invalid = -1 # invalid order
|
|
@@ -387,7 +371,7 @@ class TradeInstruction(TradeBaseClass):
|
|
|
387
371
|
side: int | float | str | TransactionSide,
|
|
388
372
|
volume: float,
|
|
389
373
|
timestamp: float,
|
|
390
|
-
order_type: int | float | str | OrderType = OrderType.
|
|
374
|
+
order_type: int | float | str | OrderType = OrderType.Generic,
|
|
391
375
|
limit_price: float = None,
|
|
392
376
|
order_id: str = None,
|
|
393
377
|
multiplier: float = None,
|
|
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
|
|
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
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|