PyAlgoEngine 0.5.4.post6__tar.gz → 0.5.4.post7__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.5.4.post6 → pyalgoengine-0.5.4.post7}/PKG-INFO +27 -27
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/PyAlgoEngine.egg-info/PKG-INFO +27 -27
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/__init__.py +1 -1
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/base/__init__.py +1 -1
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/base/market_utils.py +41 -18
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/setup.cfg +4 -4
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/LICENSE +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/PyAlgoEngine.egg-info/SOURCES.txt +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/PyAlgoEngine.egg-info/dependency_links.txt +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/PyAlgoEngine.egg-info/requires.txt +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/PyAlgoEngine.egg-info/top_level.txt +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/README.md +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/apps/__init__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/apps/backtest/__init__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/apps/backtest/doc_server.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/apps/backtest/tester.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/apps/backtest/web_app.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/apps/bokeh_server.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/apps/demo/__init__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/apps/demo/test.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/backtest/__init__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/backtest/__main__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/backtest/metrics.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/backtest/replay.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/backtest/sim_match.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/base/console_utils.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/base/finance_decimal.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/base/technical_analysis.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/base/telemetrics.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/base/trade_utils.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/engine/__init__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/engine/algo_engine.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/engine/event_engine.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/engine/market_engine.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/engine/trade_engine.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/monitor/__init__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/monitor/advanced_data_interface.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/profile/__init__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/profile/cn.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/strategy/__init__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/strategy/strategy_engine.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/utils/__init__.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/utils/commit_regularizer.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/utils/data_utils.py +0 -0
- {pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/setup.py +0 -0
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: PyAlgoEngine
|
|
3
|
-
Version: 0.5.4.
|
|
4
|
-
Summary: Basic algo engine
|
|
5
|
-
Home-page: https://github.com/BolunHan/PyAlgoEngine
|
|
6
|
-
Author: Bolun.Han
|
|
7
|
-
Author-email: Bolun.Han@outlook.com
|
|
8
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Requires-Python: >=3.1
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
16
|
-
License-File: LICENSE
|
|
17
|
-
Requires-Dist: numpy
|
|
18
|
-
Requires-Dist: pandas
|
|
19
|
-
Requires-Dist: exchange_calendars
|
|
20
|
-
Requires-Dist: PyEventEngine
|
|
21
|
-
Provides-Extra: webapps
|
|
22
|
-
Requires-Dist: flask; extra == "webapps"
|
|
23
|
-
Requires-Dist: waitress; extra == "webapps"
|
|
24
|
-
Requires-Dist: bokeh; extra == "webapps"
|
|
25
|
-
|
|
26
|
-
# PyAlgoEngine
|
|
27
|
-
python algo trading engine
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: PyAlgoEngine
|
|
3
|
+
Version: 0.5.4.post7
|
|
4
|
+
Summary: Basic algo engine
|
|
5
|
+
Home-page: https://github.com/BolunHan/PyAlgoEngine
|
|
6
|
+
Author: Bolun.Han
|
|
7
|
+
Author-email: Bolun.Han@outlook.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Requires-Python: >=3.1
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: numpy
|
|
18
|
+
Requires-Dist: pandas
|
|
19
|
+
Requires-Dist: exchange_calendars
|
|
20
|
+
Requires-Dist: PyEventEngine
|
|
21
|
+
Provides-Extra: webapps
|
|
22
|
+
Requires-Dist: flask; extra == "webapps"
|
|
23
|
+
Requires-Dist: waitress; extra == "webapps"
|
|
24
|
+
Requires-Dist: bokeh; extra == "webapps"
|
|
25
|
+
|
|
26
|
+
# PyAlgoEngine
|
|
27
|
+
python algo trading engine
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: PyAlgoEngine
|
|
3
|
-
Version: 0.5.4.
|
|
4
|
-
Summary: Basic algo engine
|
|
5
|
-
Home-page: https://github.com/BolunHan/PyAlgoEngine
|
|
6
|
-
Author: Bolun.Han
|
|
7
|
-
Author-email: Bolun.Han@outlook.com
|
|
8
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
-
Classifier: Operating System :: OS Independent
|
|
14
|
-
Requires-Python: >=3.1
|
|
15
|
-
Description-Content-Type: text/markdown
|
|
16
|
-
License-File: LICENSE
|
|
17
|
-
Requires-Dist: numpy
|
|
18
|
-
Requires-Dist: pandas
|
|
19
|
-
Requires-Dist: exchange_calendars
|
|
20
|
-
Requires-Dist: PyEventEngine
|
|
21
|
-
Provides-Extra: webapps
|
|
22
|
-
Requires-Dist: flask; extra == "webapps"
|
|
23
|
-
Requires-Dist: waitress; extra == "webapps"
|
|
24
|
-
Requires-Dist: bokeh; extra == "webapps"
|
|
25
|
-
|
|
26
|
-
# PyAlgoEngine
|
|
27
|
-
python algo trading engine
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: PyAlgoEngine
|
|
3
|
+
Version: 0.5.4.post7
|
|
4
|
+
Summary: Basic algo engine
|
|
5
|
+
Home-page: https://github.com/BolunHan/PyAlgoEngine
|
|
6
|
+
Author: Bolun.Han
|
|
7
|
+
Author-email: Bolun.Han@outlook.com
|
|
8
|
+
Classifier: Programming Language :: Python :: 3.8
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.9
|
|
10
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
11
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
13
|
+
Classifier: Operating System :: OS Independent
|
|
14
|
+
Requires-Python: >=3.1
|
|
15
|
+
Description-Content-Type: text/markdown
|
|
16
|
+
License-File: LICENSE
|
|
17
|
+
Requires-Dist: numpy
|
|
18
|
+
Requires-Dist: pandas
|
|
19
|
+
Requires-Dist: exchange_calendars
|
|
20
|
+
Requires-Dist: PyEventEngine
|
|
21
|
+
Provides-Extra: webapps
|
|
22
|
+
Requires-Dist: flask; extra == "webapps"
|
|
23
|
+
Requires-Dist: waitress; extra == "webapps"
|
|
24
|
+
Requires-Dist: bokeh; extra == "webapps"
|
|
25
|
+
|
|
26
|
+
# PyAlgoEngine
|
|
27
|
+
python algo trading engine
|
|
@@ -22,7 +22,7 @@ from .console_utils import Progress, GetInput, GetArgs, count_ordinal, TerminalS
|
|
|
22
22
|
|
|
23
23
|
__all__ = ['PROFILE',
|
|
24
24
|
'FinancialDecimal',
|
|
25
|
-
'TransactionSide', 'MarketData', 'OrderBook', 'BarData', 'TickData', 'TransactionData', 'TradeData', 'OrderBookBuffer', 'BarDataBuffer', 'TickDataBuffer', 'TransactionDataBuffer',
|
|
25
|
+
'TransactionSide', 'MarketData', 'OrderBook', 'BarData', 'DailyBar', 'CandleStick', 'TickData', 'TransactionData', 'TradeData', 'OrderBookBuffer', 'BarDataBuffer', 'TickDataBuffer', 'TransactionDataBuffer',
|
|
26
26
|
'TechnicalAnalysis',
|
|
27
27
|
'OrderState', 'OrderType', 'TradeInstruction', 'TradeReport',
|
|
28
28
|
'Progress', 'GetInput', 'GetArgs', 'count_ordinal', 'TerminalStyle', 'InteractiveShell', 'ShellTransfer']
|
|
@@ -9,7 +9,7 @@ import re
|
|
|
9
9
|
import warnings
|
|
10
10
|
from ctypes import c_ulong, c_double, c_wchar, c_int, c_longlong
|
|
11
11
|
from multiprocessing import RawValue, RawArray
|
|
12
|
-
from typing import overload
|
|
12
|
+
from typing import overload, Literal
|
|
13
13
|
|
|
14
14
|
import numpy as np
|
|
15
15
|
|
|
@@ -733,7 +733,7 @@ class BarData(MarketData):
|
|
|
733
733
|
raise ValueError(f'Invalid bar_span, expect int, float or timedelta, got {bar_span}')
|
|
734
734
|
|
|
735
735
|
def __repr__(self):
|
|
736
|
-
return f'<
|
|
736
|
+
return f'<{self.__class__.__name__}>([{self.market_time:%Y-%m-%d %H:%M:%S}] {self.ticker}, open={self.open_price}, close={self.close_price}, high={self.high_price}, low={self.low_price})'
|
|
737
737
|
|
|
738
738
|
@classmethod
|
|
739
739
|
def from_json(cls, json_message: str | bytes | bytearray | dict) -> BarData:
|
|
@@ -864,28 +864,21 @@ class BarData(MarketData):
|
|
|
864
864
|
return self.close_price
|
|
865
865
|
|
|
866
866
|
@property
|
|
867
|
-
def bar_type(self):
|
|
868
|
-
if self
|
|
869
|
-
return '
|
|
870
|
-
elif self
|
|
871
|
-
return 'Daily'
|
|
872
|
-
elif self.bar_span > datetime.timedelta(hours=1):
|
|
873
|
-
return 'Over-Hourly'
|
|
874
|
-
elif self.bar_span == datetime.timedelta(hours=1):
|
|
867
|
+
def bar_type(self) -> Literal['Hourly-Plus', 'Hourly', 'Minute-Plus', 'Minute', 'Sub-Minute']:
|
|
868
|
+
if self['bar_span'] > 3600:
|
|
869
|
+
return 'Hourly-Plus'
|
|
870
|
+
elif self['bar_span'] == 3600:
|
|
875
871
|
return 'Hourly'
|
|
876
|
-
elif self
|
|
877
|
-
return '
|
|
878
|
-
elif self
|
|
872
|
+
elif self['bar_span'] > 60:
|
|
873
|
+
return 'Minute-Plus'
|
|
874
|
+
elif self['bar_span'] == 60:
|
|
879
875
|
return 'Minute'
|
|
880
876
|
else:
|
|
881
877
|
return 'Sub-Minute'
|
|
882
878
|
|
|
883
879
|
@property
|
|
884
880
|
def bar_end_time(self) -> datetime.datetime | datetime.date:
|
|
885
|
-
|
|
886
|
-
return self.market_time.date()
|
|
887
|
-
else:
|
|
888
|
-
return self.market_time
|
|
881
|
+
return self.market_time
|
|
889
882
|
|
|
890
883
|
|
|
891
884
|
# alias of the BarData
|
|
@@ -923,9 +916,15 @@ class DailyBar(BarData):
|
|
|
923
916
|
else:
|
|
924
917
|
assert (market_date - start_date).days == bar_span.days
|
|
925
918
|
|
|
919
|
+
if timestamp is None:
|
|
920
|
+
if PROFILE.session_end is None:
|
|
921
|
+
timestamp = datetime.datetime.combine(market_date, datetime.time.min, tzinfo=PROFILE.time_zone).timestamp()
|
|
922
|
+
else:
|
|
923
|
+
timestamp = datetime.datetime.combine(market_date, PROFILE.session_end, tzinfo=PROFILE.time_zone).timestamp()
|
|
924
|
+
|
|
926
925
|
super().__init__(
|
|
927
926
|
ticker=ticker,
|
|
928
|
-
timestamp=
|
|
927
|
+
timestamp=timestamp,
|
|
929
928
|
bar_span=bar_span,
|
|
930
929
|
high_price=high_price,
|
|
931
930
|
low_price=low_price,
|
|
@@ -939,6 +938,9 @@ class DailyBar(BarData):
|
|
|
939
938
|
|
|
940
939
|
self['market_date'] = market_date
|
|
941
940
|
|
|
941
|
+
def __repr__(self):
|
|
942
|
+
return f'<{self.__class__.__name__}>([{self.market_time:%Y-%m-%d}] {self.ticker}, open={self.open_price}, close={self.close_price}, high={self.high_price}, low={self.low_price})'
|
|
943
|
+
|
|
942
944
|
@property
|
|
943
945
|
def bar_span(self) -> datetime.timedelta:
|
|
944
946
|
return datetime.timedelta(days=self['bar_span'])
|
|
@@ -947,6 +949,27 @@ class DailyBar(BarData):
|
|
|
947
949
|
def market_date(self) -> datetime.date:
|
|
948
950
|
return self['market_date']
|
|
949
951
|
|
|
952
|
+
@property
|
|
953
|
+
def market_time(self) -> datetime.date:
|
|
954
|
+
return self.market_date
|
|
955
|
+
|
|
956
|
+
@property
|
|
957
|
+
def bar_start_time(self) -> datetime.date:
|
|
958
|
+
return self.market_date - self.bar_span
|
|
959
|
+
|
|
960
|
+
@property
|
|
961
|
+
def bar_end_time(self) -> datetime.date:
|
|
962
|
+
return self.market_date
|
|
963
|
+
|
|
964
|
+
@property
|
|
965
|
+
def bar_type(self) -> Literal['Daily', 'Daily-Plus']:
|
|
966
|
+
if self['bar_span'] == 1:
|
|
967
|
+
return 'Daily'
|
|
968
|
+
elif self['bar_span'] > 1:
|
|
969
|
+
return 'Daily-Plus'
|
|
970
|
+
else:
|
|
971
|
+
raise ValueError(f'Invalid bar_span for {self.__class__.__name__}! Expect a int greater or equal to 1, got {self["bar_span"]}')
|
|
972
|
+
|
|
950
973
|
|
|
951
974
|
class TickData(MarketData):
|
|
952
975
|
def __init__(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
[egg_info]
|
|
2
|
-
tag_build =
|
|
3
|
-
tag_date = 0
|
|
4
|
-
|
|
1
|
+
[egg_info]
|
|
2
|
+
tag_build =
|
|
3
|
+
tag_date = 0
|
|
4
|
+
|
|
File without changes
|
|
File without changes
|
{pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/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
|
{pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/apps/backtest/doc_server.py
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
|
|
File without changes
|
|
File without changes
|
{pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/base/technical_analysis.py
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
|
{pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/monitor/advanced_data_interface.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/strategy/strategy_engine.py
RENAMED
|
File without changes
|
|
File without changes
|
{pyalgoengine-0.5.4.post6 → pyalgoengine-0.5.4.post7}/algo_engine/utils/commit_regularizer.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|