wiz-trader 0.6.0__py3-none-any.whl → 0.7.0__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.
- wiz_trader/__init__.py +1 -1
- wiz_trader/apis/client.py +33 -5
- {wiz_trader-0.6.0.dist-info → wiz_trader-0.7.0.dist-info}/METADATA +1 -1
- wiz_trader-0.7.0.dist-info/RECORD +9 -0
- wiz_trader-0.6.0.dist-info/RECORD +0 -9
- {wiz_trader-0.6.0.dist-info → wiz_trader-0.7.0.dist-info}/WHEEL +0 -0
- {wiz_trader-0.6.0.dist-info → wiz_trader-0.7.0.dist-info}/top_level.txt +0 -0
wiz_trader/__init__.py
CHANGED
wiz_trader/apis/client.py
CHANGED
@@ -288,18 +288,46 @@ class WizzerClient:
|
|
288
288
|
logger.debug("Fetching order: %s", order_id)
|
289
289
|
return self._make_request("GET", endpoint)
|
290
290
|
|
291
|
-
def get_positions(self) -> List[Dict[str, Any]]:
|
291
|
+
def get_positions(self, position_status: Optional[str] = None) -> List[Dict[str, Any]]:
|
292
292
|
"""
|
293
|
-
Get
|
293
|
+
Get portfolio positions with optional filtering by status.
|
294
294
|
|
295
|
+
Args:
|
296
|
+
position_status (Optional[str], optional): Filter positions by status.
|
297
|
+
Valid values: "open", "closed". If None, returns all positions.
|
298
|
+
|
295
299
|
Returns:
|
296
|
-
List[Dict[str, Any]]: List of positions.
|
300
|
+
List[Dict[str, Any]]: List of positions matching the filter criteria.
|
297
301
|
"""
|
298
302
|
endpoint = "/portfolios/positions"
|
303
|
+
params = {}
|
299
304
|
|
300
|
-
|
301
|
-
|
305
|
+
if position_status:
|
306
|
+
if position_status not in ["open", "closed"]:
|
307
|
+
raise ValueError("position_status must be either 'open', 'closed', or None")
|
308
|
+
params["positionStatus"] = position_status
|
309
|
+
|
310
|
+
logger.debug("Fetching positions with status: %s", position_status or "all")
|
311
|
+
return self._make_request("GET", endpoint, params=params)
|
312
|
+
|
313
|
+
def get_open_positions(self) -> List[Dict[str, Any]]:
|
314
|
+
"""
|
315
|
+
Get all open positions in the portfolio.
|
302
316
|
|
317
|
+
Returns:
|
318
|
+
List[Dict[str, Any]]: List of open positions.
|
319
|
+
"""
|
320
|
+
return self.get_positions(position_status="open")
|
321
|
+
|
322
|
+
def get_closed_positions(self) -> List[Dict[str, Any]]:
|
323
|
+
"""
|
324
|
+
Get all closed positions in the portfolio.
|
325
|
+
|
326
|
+
Returns:
|
327
|
+
List[Dict[str, Any]]: List of closed positions.
|
328
|
+
"""
|
329
|
+
return self.get_positions(position_status="closed")
|
330
|
+
|
303
331
|
def get_holdings(self, portfolios: Optional[str] = "default") -> List[Dict[str, Any]]:
|
304
332
|
"""
|
305
333
|
Get current holdings.
|
@@ -0,0 +1,9 @@
|
|
1
|
+
wiz_trader/__init__.py,sha256=V4DgwVGNtcnqYZhVe7pww5-IHtYqge5CQXqkaS81mfo,181
|
2
|
+
wiz_trader/apis/__init__.py,sha256=ItWKMOl4omiW0g2f-M7WRW3v-dss_ULd9vYnFyIIT9o,132
|
3
|
+
wiz_trader/apis/client.py,sha256=rq6FEA5DDCGXc4axSSzOdVvet1NWlW8L843GMp0qXQA,20562
|
4
|
+
wiz_trader/quotes/__init__.py,sha256=RF9g9CNP6bVWlmCh_ad8krm3-EWOIuVfLp0-H9fAeEM,108
|
5
|
+
wiz_trader/quotes/client.py,sha256=fUHTMGDauGF9cjsFsVAzoOwqSgD555_TLoNqmnFhLdQ,6203
|
6
|
+
wiz_trader-0.7.0.dist-info/METADATA,sha256=kqDpwsUfiECcbxhVKPUEuSedAu50L-OOPX2M4JAW12o,4281
|
7
|
+
wiz_trader-0.7.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
+
wiz_trader-0.7.0.dist-info/top_level.txt,sha256=lnYS_g8LlA6ryKYnvY8xIQ6K2K-xzOsd-99AWgnW6VY,11
|
9
|
+
wiz_trader-0.7.0.dist-info/RECORD,,
|
@@ -1,9 +0,0 @@
|
|
1
|
-
wiz_trader/__init__.py,sha256=JiaZxkGCn6_xuj984d1Z7fReHmjs9gJllHXGcdo-gk8,181
|
2
|
-
wiz_trader/apis/__init__.py,sha256=ItWKMOl4omiW0g2f-M7WRW3v-dss_ULd9vYnFyIIT9o,132
|
3
|
-
wiz_trader/apis/client.py,sha256=M4n86Z5Niv7TRvYkChHlq3puJdHt0Ej8fIM7lgrrT84,19514
|
4
|
-
wiz_trader/quotes/__init__.py,sha256=RF9g9CNP6bVWlmCh_ad8krm3-EWOIuVfLp0-H9fAeEM,108
|
5
|
-
wiz_trader/quotes/client.py,sha256=fUHTMGDauGF9cjsFsVAzoOwqSgD555_TLoNqmnFhLdQ,6203
|
6
|
-
wiz_trader-0.6.0.dist-info/METADATA,sha256=3JNh3TblqfCNrFGgA6RoxauExKyGPDOyYaBQ-cRTHYY,4281
|
7
|
-
wiz_trader-0.6.0.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
8
|
-
wiz_trader-0.6.0.dist-info/top_level.txt,sha256=lnYS_g8LlA6ryKYnvY8xIQ6K2K-xzOsd-99AWgnW6VY,11
|
9
|
-
wiz_trader-0.6.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|