onesecondtrader 0.45.0__tar.gz → 0.46.0__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.
Files changed (20) hide show
  1. {onesecondtrader-0.45.0 → onesecondtrader-0.46.0}/PKG-INFO +1 -1
  2. {onesecondtrader-0.45.0 → onesecondtrader-0.46.0}/pyproject.toml +1 -1
  3. onesecondtrader-0.46.0/src/onesecondtrader/events/base.py +21 -0
  4. onesecondtrader-0.46.0/src/onesecondtrader/events/requests/__init__.py +9 -0
  5. onesecondtrader-0.46.0/src/onesecondtrader/events/requests/order_cancellation.py +23 -0
  6. onesecondtrader-0.46.0/src/onesecondtrader/events/requests/order_modification.py +29 -0
  7. onesecondtrader-0.46.0/src/onesecondtrader/events/requests/order_submission.py +33 -0
  8. onesecondtrader-0.46.0/src/onesecondtrader/models/bar_fields.py +23 -0
  9. onesecondtrader-0.46.0/src/onesecondtrader/models/bar_period.py +21 -0
  10. onesecondtrader-0.46.0/src/onesecondtrader/models/order_types.py +21 -0
  11. {onesecondtrader-0.45.0 → onesecondtrader-0.46.0}/src/onesecondtrader/models/trade_sides.py +4 -4
  12. onesecondtrader-0.45.0/src/onesecondtrader/events/base.py +0 -19
  13. onesecondtrader-0.45.0/src/onesecondtrader/models/bar_fields.py +0 -23
  14. onesecondtrader-0.45.0/src/onesecondtrader/models/bar_period.py +0 -21
  15. onesecondtrader-0.45.0/src/onesecondtrader/models/order_types.py +0 -21
  16. {onesecondtrader-0.45.0 → onesecondtrader-0.46.0}/LICENSE +0 -0
  17. {onesecondtrader-0.45.0 → onesecondtrader-0.46.0}/README.md +0 -0
  18. {onesecondtrader-0.45.0 → onesecondtrader-0.46.0}/src/onesecondtrader/__init__.py +0 -0
  19. {onesecondtrader-0.45.0 → onesecondtrader-0.46.0}/src/onesecondtrader/events/__init__.py +0 -0
  20. {onesecondtrader-0.45.0 → onesecondtrader-0.46.0}/src/onesecondtrader/models/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: onesecondtrader
3
- Version: 0.45.0
3
+ Version: 0.46.0
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.45.0"
3
+ version = "0.46.0"
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"}
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ import dataclasses
4
+ import time
5
+
6
+
7
+ @dataclasses.dataclass(kw_only=True, frozen=True, slots=True)
8
+ class EventBase:
9
+ """
10
+ Base class for immutable event message objects, using Unix epoch nanoseconds.
11
+
12
+ | Field | Type | Semantics |
13
+ |-----------------|--------|------------------------------------------------------------------------|
14
+ | `ts_event_ns` | `int` | Time at which the represented fact occurred, as UTC epoch nanoseconds. |
15
+ | `ts_created_ns` | `int` | Time at which the event object was created, as UTC epoch nanoseconds. |
16
+
17
+ If not provided, `ts_created_ns` is assigned automatically at object creation.
18
+ """
19
+
20
+ ts_event_ns: int
21
+ ts_created_ns: int = dataclasses.field(default_factory=time.time_ns)
@@ -0,0 +1,9 @@
1
+ from .order_submission import OrderSubmissionRequest
2
+ from .order_cancellation import OrderCancellationRequest
3
+ from .order_modification import OrderModificationRequest
4
+
5
+ __all__ = [
6
+ "OrderSubmissionRequest",
7
+ "OrderCancellationRequest",
8
+ "OrderModificationRequest",
9
+ ]
@@ -0,0 +1,23 @@
1
+ from __future__ import annotations
2
+
3
+ import dataclasses
4
+ import uuid
5
+
6
+ from onesecondtrader import events
7
+
8
+
9
+ @dataclasses.dataclass(kw_only=True, frozen=True, slots=True)
10
+ class OrderCancellationRequest(events.EventBase):
11
+ """
12
+ Event representing a request to cancel an existing order.
13
+
14
+ | Field | Type | Semantics |
15
+ |-------------------|-------------|---------------------------------------------------------------------|
16
+ | `ts_event_ns` | `int` | Time at which the cancellation request was issued, as UTC epoch ns. |
17
+ | `ts_created_ns` | `int` | Time at which the event object was created, as UTC epoch ns. |
18
+ | `system_order_id` | `uuid.UUID` | System-assigned identifier of the order to be cancelled. |
19
+ | `symbol` | `str` | Identifier of the traded instrument. |
20
+ """
21
+
22
+ system_order_id: uuid.UUID
23
+ symbol: str
@@ -0,0 +1,29 @@
1
+ from __future__ import annotations
2
+
3
+ import dataclasses
4
+ import uuid
5
+
6
+ from onesecondtrader import events
7
+
8
+
9
+ @dataclasses.dataclass(kw_only=True, frozen=True, slots=True)
10
+ class OrderModificationRequest(events.EventBase):
11
+ """
12
+ Event representing a request to modify an existing order.
13
+
14
+ | Field | Type | Semantics |
15
+ |-------------------|-------------------|------------------------------------------------------------------------------|
16
+ | `ts_event_ns` | `int` | Time at which the modification request was issued, as UTC epoch nanoseconds. |
17
+ | `ts_created_ns` | `int` | Time at which the event object was created, as UTC epoch nanoseconds. |
18
+ | `system_order_id` | `uuid.UUID` | System-assigned identifier of the order to be modified. |
19
+ | `symbol` | `str` | Identifier of the traded instrument. |
20
+ | `quantity` | `float` or `None` | Updated order quantity, if modified. |
21
+ | `limit_price` | `float` or `None` | Updated limit price, if modified. |
22
+ | `stop_price` | `float` or `None` | Updated stop price, if modified. |
23
+ """
24
+
25
+ system_order_id: uuid.UUID
26
+ symbol: str
27
+ quantity: float | None = None
28
+ limit_price: float | None = None
29
+ stop_price: float | None = None
@@ -0,0 +1,33 @@
1
+ from __future__ import annotations
2
+
3
+ import dataclasses
4
+ import uuid
5
+
6
+ from onesecondtrader import events, models
7
+
8
+
9
+ @dataclasses.dataclass(kw_only=True, frozen=True, slots=True)
10
+ class OrderSubmissionRequest(events.EventBase):
11
+ """
12
+ Event representing a request to submit a new order to a broker.
13
+
14
+ | Field | Type | Semantics |
15
+ |-------------------|--------------------------|----------------------------------------------------------------------------|
16
+ | `ts_event_ns` | `int` | Time at which the submission request was issued, as UTC epoch nanoseconds. |
17
+ | `ts_created_ns` | `int` | Time at which the event object was created, as UTC epoch nanoseconds. |
18
+ | `system_order_id` | `uuid.UUID` | System-assigned unique identifier for the order submission. |
19
+ | `symbol` | `str` | Identifier of the traded instrument. |
20
+ | `order_type` | `models.OrderType` | Execution constraint of the order. |
21
+ | `side` | `models.TradeSide` | Direction of the trade. |
22
+ | `quantity` | `float` | Requested order quantity. |
23
+ | `limit_price` | `float` or `None` | Limit price, if applicable to the order type. |
24
+ | `stop_price` | `float` or `None` | Stop price, if applicable to the order type. |
25
+ """
26
+
27
+ system_order_id: uuid.UUID = dataclasses.field(default_factory=uuid.uuid4)
28
+ symbol: str
29
+ order_type: models.OrderType
30
+ side: models.TradeSide
31
+ quantity: float
32
+ limit_price: float | None = None
33
+ stop_price: float | None = None
@@ -0,0 +1,23 @@
1
+ from __future__ import annotations
2
+
3
+ import enum
4
+
5
+
6
+ class BarField(enum.Enum):
7
+ """
8
+ Enumeration of bar fields used as indicator inputs.
9
+
10
+ | Value | Semantics |
11
+ |----------|------------------------------------|
12
+ | `OPEN` | Bar's opening value. |
13
+ | `HIGH` | Bar's highest value. |
14
+ | `LOW` | Bar's lowest value. |
15
+ | `CLOSE` | Bar's closing value. |
16
+ | `VOLUME` | Bar's traded volume. |
17
+ """
18
+
19
+ OPEN = enum.auto()
20
+ HIGH = enum.auto()
21
+ LOW = enum.auto()
22
+ CLOSE = enum.auto()
23
+ VOLUME = enum.auto()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ import enum
4
+
5
+
6
+ class BarPeriod(enum.Enum):
7
+ """
8
+ Enumeration of bar aggregation periods.
9
+
10
+ | Value | Semantics |
11
+ |----------|----------------------|
12
+ | `SECOND` | Duration of 1 second.|
13
+ | `MINUTE` | Duration of 1 minute.|
14
+ | `HOUR` | Duration of 1 hour. |
15
+ | `DAY` | Duration of 1 day. |
16
+ """
17
+
18
+ SECOND = enum.auto()
19
+ MINUTE = enum.auto()
20
+ HOUR = enum.auto()
21
+ DAY = enum.auto()
@@ -0,0 +1,21 @@
1
+ from __future__ import annotations
2
+
3
+ import enum
4
+
5
+
6
+ class OrderType(enum.Enum):
7
+ """
8
+ Enumeration of order execution types.
9
+
10
+ | Value | Semantics |
11
+ |--------------|-------------------------------------------------------------|
12
+ | `LIMIT` | Executable only at the specified limit price or better. |
13
+ | `MARKET` | Executable immediately at the best available market price. |
14
+ | `STOP` | Becomes a market order once the stop price is reached. |
15
+ | `STOP_LIMIT` | Becomes a limit order once the stop price is reached. |
16
+ """
17
+
18
+ LIMIT = enum.auto()
19
+ MARKET = enum.auto()
20
+ STOP = enum.auto()
21
+ STOP_LIMIT = enum.auto()
@@ -10,10 +10,10 @@ class TradeSide(enum.Enum):
10
10
  `OrderSide` specifies the direction of change applied to the (net) signed position
11
11
  quantity from the perspective of the trading account.
12
12
 
13
- | Value | Semantics |
14
- |-------|------------------------------------------------|
15
- | BUY | Increases the signed position quantity. |
16
- | SELL | Decreases the signed position quantity. |
13
+ | Value | Semantics |
14
+ |---------|------------------------------------------------|
15
+ | `BUY` | Increases the signed position quantity. |
16
+ | `SELL` | Decreases the signed position quantity. |
17
17
  """
18
18
 
19
19
  BUY = enum.auto()
@@ -1,19 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import dataclasses
4
- import time
5
-
6
-
7
- @dataclasses.dataclass(kw_only=True, frozen=True, slots=True)
8
- class EventBase:
9
- """
10
- Base class for immutable event message objects, using Unix epoch nanoseconds.
11
-
12
- | Field | Type | Semantics |
13
- |---------------|------|------------------------------------------------------------------------|
14
- | ts_event_ns | int | Time at which the represented fact occurred, as UTC epoch nanoseconds. |
15
- | ts_created_ns | int | Time at which the event object was created, as UTC epoch nanoseconds. |
16
- """
17
-
18
- ts_event_ns: int
19
- ts_created_ns: int = dataclasses.field(default_factory=time.time_ns)
@@ -1,23 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import enum
4
-
5
-
6
- class BarField(enum.Enum):
7
- """
8
- Enumeration of bar fields used as indicator inputs.
9
-
10
- | Value | Semantics |
11
- |--------|------------------------------------|
12
- | OPEN | Bar's opening value. |
13
- | HIGH | Bar's highest value. |
14
- | LOW | Bar's lowest value. |
15
- | CLOSE | Bar's closing value. |
16
- | VOLUME | Bar's traded volume. |
17
- """
18
-
19
- OPEN = enum.auto()
20
- HIGH = enum.auto()
21
- LOW = enum.auto()
22
- CLOSE = enum.auto()
23
- VOLUME = enum.auto()
@@ -1,21 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import enum
4
-
5
-
6
- class BarPeriod(enum.Enum):
7
- """
8
- Enumeration of bar aggregation periods.
9
-
10
- | Value | Semantics |
11
- |--------|----------------------|
12
- | SECOND | Duration of 1 second.|
13
- | MINUTE | Duration of 1 minute.|
14
- | HOUR | Duration of 1 hour. |
15
- | DAY | Duration of 1 day. |
16
- """
17
-
18
- SECOND = enum.auto()
19
- MINUTE = enum.auto()
20
- HOUR = enum.auto()
21
- DAY = enum.auto()
@@ -1,21 +0,0 @@
1
- from __future__ import annotations
2
-
3
- import enum
4
-
5
-
6
- class OrderType(enum.Enum):
7
- """
8
- Enumeration of order execution types.
9
-
10
- | Value | Semantics |
11
- |-------------|-------------------------------------------------------------|
12
- | LIMIT | Executable only at the specified limit price or better. |
13
- | MARKET | Executable immediately at the best available market price. |
14
- | STOP | Becomes a market order once the stop price is reached. |
15
- | STOP_LIMIT | Becomes a limit order once the stop price is reached. |
16
- """
17
-
18
- LIMIT = enum.auto()
19
- MARKET = enum.auto()
20
- STOP = enum.auto()
21
- STOP_LIMIT = enum.auto()