pdmt5 0.2.0__py3-none-any.whl → 0.2.1__py3-none-any.whl
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.
pdmt5/trading.py
CHANGED
|
@@ -131,6 +131,7 @@ class Mt5TradingClient(Mt5DataClient):
|
|
|
131
131
|
self,
|
|
132
132
|
symbol: str | None = None,
|
|
133
133
|
order_filling_mode: Literal["IOC", "FOK", "RETURN"] = "IOC",
|
|
134
|
+
raise_on_error: bool = False,
|
|
134
135
|
dry_run: bool = False,
|
|
135
136
|
**kwargs: Any, # noqa: ANN401
|
|
136
137
|
) -> list[dict[str, Any]]:
|
|
@@ -139,6 +140,7 @@ class Mt5TradingClient(Mt5DataClient):
|
|
|
139
140
|
Args:
|
|
140
141
|
symbol: Optional symbol filter.
|
|
141
142
|
order_filling_mode: Order filling mode, either "IOC", "FOK", or "RETURN".
|
|
143
|
+
raise_on_error: If True, raise an exception on error.
|
|
142
144
|
dry_run: If True, only check the order without sending it.
|
|
143
145
|
**kwargs: Additional keyword arguments for request parameters.
|
|
144
146
|
|
|
@@ -170,6 +172,7 @@ class Mt5TradingClient(Mt5DataClient):
|
|
|
170
172
|
"position": p["ticket"],
|
|
171
173
|
**kwargs,
|
|
172
174
|
},
|
|
175
|
+
raise_on_error=raise_on_error,
|
|
173
176
|
dry_run=dry_run,
|
|
174
177
|
)
|
|
175
178
|
for p in positions_dict
|
|
@@ -225,6 +228,7 @@ class Mt5TradingClient(Mt5DataClient):
|
|
|
225
228
|
order_side: Literal["BUY", "SELL"],
|
|
226
229
|
order_filling_mode: Literal["IOC", "FOK", "RETURN"] = "IOC",
|
|
227
230
|
order_time_mode: Literal["GTC", "DAY", "SPECIFIED", "SPECIFIED_DAY"] = "GTC",
|
|
231
|
+
raise_on_error: bool = False,
|
|
228
232
|
dry_run: bool = False,
|
|
229
233
|
**kwargs: Any, # noqa: ANN401
|
|
230
234
|
) -> dict[str, Any]:
|
|
@@ -237,6 +241,7 @@ class Mt5TradingClient(Mt5DataClient):
|
|
|
237
241
|
order_filling_mode: Order filling mode, either "IOC", "FOK", or "RETURN".
|
|
238
242
|
order_time_mode: Order time mode, either "GTC", "DAY", "SPECIFIED",
|
|
239
243
|
or "SPECIFIED_DAY".
|
|
244
|
+
raise_on_error: If True, raise an error on operation failure.
|
|
240
245
|
dry_run: If True, only check the order without sending it.
|
|
241
246
|
**kwargs: Additional keyword arguments for request parameters.
|
|
242
247
|
|
|
@@ -256,6 +261,7 @@ class Mt5TradingClient(Mt5DataClient):
|
|
|
256
261
|
"type_time": getattr(self.mt5, f"ORDER_TIME_{order_time_mode.upper()}"),
|
|
257
262
|
**kwargs,
|
|
258
263
|
},
|
|
264
|
+
raise_on_error=raise_on_error,
|
|
259
265
|
dry_run=dry_run,
|
|
260
266
|
)
|
|
261
267
|
|
|
@@ -265,6 +271,7 @@ class Mt5TradingClient(Mt5DataClient):
|
|
|
265
271
|
stop_loss: float | None = None,
|
|
266
272
|
take_profit: float | None = None,
|
|
267
273
|
tickets: list[int] | None = None,
|
|
274
|
+
raise_on_error: bool = False,
|
|
268
275
|
dry_run: bool = False,
|
|
269
276
|
**kwargs: Any, # noqa: ANN401
|
|
270
277
|
) -> list[dict[str, Any]]:
|
|
@@ -276,6 +283,7 @@ class Mt5TradingClient(Mt5DataClient):
|
|
|
276
283
|
take_profit: New Take Profit price. If None, it will not be changed.
|
|
277
284
|
tickets: List of position tickets to filter positions. If None, all open
|
|
278
285
|
positions for the symbol will be considered.
|
|
286
|
+
raise_on_error: If True, raise an error on operation failure.
|
|
279
287
|
dry_run: If True, only check the order without sending it.
|
|
280
288
|
**kwargs: Additional keyword arguments for request parameters.
|
|
281
289
|
|
|
@@ -324,7 +332,9 @@ class Mt5TradingClient(Mt5DataClient):
|
|
|
324
332
|
tp,
|
|
325
333
|
)
|
|
326
334
|
return [
|
|
327
|
-
self._send_or_check_order(
|
|
335
|
+
self._send_or_check_order(
|
|
336
|
+
request=r, raise_on_error=raise_on_error, dry_run=dry_run
|
|
337
|
+
)
|
|
328
338
|
for r in order_requests
|
|
329
339
|
]
|
|
330
340
|
else:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: pdmt5
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1
|
|
4
4
|
Summary: Pandas-based data handler for MetaTrader 5
|
|
5
5
|
Project-URL: Repository, https://github.com/dceoy/pdmt5.git
|
|
6
6
|
Author-email: dceoy <dceoy@users.noreply.github.com>
|
|
@@ -15,7 +15,7 @@ Classifier: Operating System :: Microsoft :: Windows
|
|
|
15
15
|
Classifier: Programming Language :: Python
|
|
16
16
|
Classifier: Programming Language :: Python :: 3
|
|
17
17
|
Classifier: Topic :: Office/Business :: Financial :: Investment
|
|
18
|
-
Requires-Python:
|
|
18
|
+
Requires-Python: <3.14,>=3.11
|
|
19
19
|
Requires-Dist: metatrader5>=5.0.4424; sys_platform == 'win32'
|
|
20
20
|
Requires-Dist: pandas>=2.2.2
|
|
21
21
|
Requires-Dist: pydantic>=2.9.0
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
pdmt5/__init__.py,sha256=QbSFrsi7_bgFzb-ma4DmmUjR90UvrqKMnRZq1wPRmoI,446
|
|
2
2
|
pdmt5/dataframe.py,sha256=rUWtR23hrXBdBqzJhbOlIemNy73RrjSTZZJUhwoL6io,38084
|
|
3
3
|
pdmt5/mt5.py,sha256=KgxHapIrh5b4L0wIOAQIjfXNZafalihbFrh9fhYHmrI,32254
|
|
4
|
-
pdmt5/trading.py,sha256=
|
|
4
|
+
pdmt5/trading.py,sha256=Qd4RhZprDcWTzT3JmKl8XGVq8i9hExNdPSJbCRdUx-s,25569
|
|
5
5
|
pdmt5/utils.py,sha256=Ll5Q3OE5h1A_sZ_qVEnOPGniFlT6_MmHfuu0zqeLdeU,3913
|
|
6
|
-
pdmt5-0.2.
|
|
7
|
-
pdmt5-0.2.
|
|
8
|
-
pdmt5-0.2.
|
|
9
|
-
pdmt5-0.2.
|
|
6
|
+
pdmt5-0.2.1.dist-info/METADATA,sha256=OjDjumI_5kGHyEjpIg-xgZyGJSULRUJM_LQnv2IeJ-4,16100
|
|
7
|
+
pdmt5-0.2.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
8
|
+
pdmt5-0.2.1.dist-info/licenses/LICENSE,sha256=iABrdaUGOBWLYotFupB_PGe8arV5o7rVhn-_vK6P704,1073
|
|
9
|
+
pdmt5-0.2.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|