onesecondtrader 0.12.0__tar.gz → 0.12.1__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.
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/PKG-INFO +1 -1
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/pyproject.toml +1 -1
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/indicators/base_indicator.py +18 -19
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/LICENSE +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/README.md +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/__init__.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/core/__init__.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/core/models.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/core/py.typed +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/datafeeds/__init__.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/datafeeds/base_datafeed.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/datafeeds/csv_datafeed.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/indicators/__init__.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/messaging/__init__.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/messaging/eventbus.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/messaging/events.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/monitoring/__init__.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/monitoring/console.py +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/monitoring/py.typed +0 -0
- {onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: onesecondtrader
|
|
3
|
-
Version: 0.12.
|
|
3
|
+
Version: 0.12.1
|
|
4
4
|
Summary: The Trading Infrastructure Toolkit for Python. Research, simulate, and deploy algorithmic trading strategies — all in one place.
|
|
5
5
|
License-File: LICENSE
|
|
6
6
|
Author: Nils P. Kujath
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "onesecondtrader"
|
|
3
|
-
version = "0.12.
|
|
3
|
+
version = "0.12.1"
|
|
4
4
|
description = "The Trading Infrastructure Toolkit for Python. Research, simulate, and deploy algorithmic trading strategies — all in one place."
|
|
5
5
|
authors = [
|
|
6
6
|
{name = "Nils P. Kujath",email = "63961429+NilsKujath@users.noreply.github.com"}
|
{onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/indicators/base_indicator.py
RENAMED
|
@@ -16,8 +16,7 @@ class BaseIndicator(abc.ABC):
|
|
|
16
16
|
Base class for all indicators.
|
|
17
17
|
|
|
18
18
|
If new market data is received, the indicator is updated by calling the
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
`update(incoming_bar)` method.
|
|
21
20
|
When programming a new indicator, only the `name` property and the
|
|
22
21
|
`_compute_indicator()` method need to be implemented.
|
|
23
22
|
|
|
@@ -84,6 +83,15 @@ class BaseIndicator(abc.ABC):
|
|
|
84
83
|
"""
|
|
85
84
|
pass
|
|
86
85
|
|
|
86
|
+
@property
|
|
87
|
+
def latest(self) -> float:
|
|
88
|
+
"""
|
|
89
|
+
The latest (most recent) indicator value.
|
|
90
|
+
|
|
91
|
+
Equivalent to self[0]. Returns numpy.nan when no value is available yet.
|
|
92
|
+
"""
|
|
93
|
+
return self[0]
|
|
94
|
+
|
|
87
95
|
def update(self, incoming_bar: models.Bar) -> None:
|
|
88
96
|
"""
|
|
89
97
|
Updates the indicator based on an incoming closed bar by calling
|
|
@@ -93,6 +101,14 @@ class BaseIndicator(abc.ABC):
|
|
|
93
101
|
with self._lock:
|
|
94
102
|
self._history.append(new_value)
|
|
95
103
|
|
|
104
|
+
@abc.abstractmethod
|
|
105
|
+
def _compute_indicator(self, incoming_bar: models.Bar) -> float:
|
|
106
|
+
"""
|
|
107
|
+
Computes the new indicator value based on an incoming closed bar.
|
|
108
|
+
This method must be implemented by subclasses.
|
|
109
|
+
"""
|
|
110
|
+
pass
|
|
111
|
+
|
|
96
112
|
def __getitem__(self, index: int) -> float:
|
|
97
113
|
"""
|
|
98
114
|
Return the indicator value at the given index with tolerant indexing.
|
|
@@ -118,20 +134,3 @@ class BaseIndicator(abc.ABC):
|
|
|
118
134
|
return self._history[normalized]
|
|
119
135
|
except IndexError:
|
|
120
136
|
return np.nan
|
|
121
|
-
|
|
122
|
-
@property
|
|
123
|
-
def latest(self) -> float:
|
|
124
|
-
"""
|
|
125
|
-
The latest (most recent) indicator value.
|
|
126
|
-
|
|
127
|
-
Equivalent to self[0]. Returns numpy.nan when no value is available yet.
|
|
128
|
-
"""
|
|
129
|
-
return self[0]
|
|
130
|
-
|
|
131
|
-
@abc.abstractmethod
|
|
132
|
-
def _compute_indicator(self, incoming_bar: models.Bar) -> float:
|
|
133
|
-
"""
|
|
134
|
-
Computes the new indicator value based on an incoming closed bar.
|
|
135
|
-
This method must be implemented by subclasses.
|
|
136
|
-
"""
|
|
137
|
-
pass
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/datafeeds/base_datafeed.py
RENAMED
|
File without changes
|
{onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/datafeeds/csv_datafeed.py
RENAMED
|
File without changes
|
{onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/indicators/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{onesecondtrader-0.12.0 → onesecondtrader-0.12.1}/src/onesecondtrader/monitoring/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|