wiz-trader 0.39.0__py3-none-any.whl → 0.40.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 +188 -3
- {wiz_trader-0.39.0.dist-info → wiz_trader-0.40.0.dist-info}/METADATA +44 -2
- wiz_trader-0.40.0.dist-info/RECORD +9 -0
- wiz_trader-0.39.0.dist-info/RECORD +0 -9
- {wiz_trader-0.39.0.dist-info → wiz_trader-0.40.0.dist-info}/WHEEL +0 -0
- {wiz_trader-0.39.0.dist-info → wiz_trader-0.40.0.dist-info}/top_level.txt +0 -0
wiz_trader/__init__.py
CHANGED
wiz_trader/apis/client.py
CHANGED
@@ -282,11 +282,15 @@ class WizzerClient:
|
|
282
282
|
"analytics.marketdata.average_volume": "/analytics/marketdata/averageVolume",
|
283
283
|
"analytics.index.max_drawdown": "/analytics/index/metrics/maxDrawdown",
|
284
284
|
"analytics.instrument.drawdown_duration": "/analytics/instrument/metrics/drawdownDuration",
|
285
|
-
"analytics.price.rolling_peak": "/analytics/
|
286
|
-
"analytics.price.rolling_mean": "/analytics/
|
287
|
-
"analytics.volatility.realized": "/analytics/
|
285
|
+
"analytics.price.rolling_peak": "/analytics/price/rollingPeak",
|
286
|
+
"analytics.price.rolling_mean": "/analytics/price/rollingMean",
|
287
|
+
"analytics.volatility.realized": "/analytics/volatility/realized",
|
288
288
|
"analytics.risk.beta_90d": "/analytics/risk/beta90d",
|
289
289
|
"analytics.risk.beta_custom": "/analytics/risk/beta",
|
290
|
+
"analytics.strategy.drawdown_max": "/analytics/strategy/drawdown/max",
|
291
|
+
"analytics.product.drawdown_max": "/analytics/product/drawdown/max",
|
292
|
+
"analytics.volatility.atr": "/analytics/volatility/atr",
|
293
|
+
"analytics.returns.simple": "/analytics/returns/simple",
|
290
294
|
|
291
295
|
}
|
292
296
|
|
@@ -3875,3 +3879,184 @@ class WizzerClient:
|
|
3875
3879
|
|
3876
3880
|
logger.debug("Fetching custom period beta for %s vs %s from %s to %s", symbol, benchmark, start_date, end_date)
|
3877
3881
|
return self._make_request("GET", self._routes["analytics.risk.beta_custom"], params=params)
|
3882
|
+
|
3883
|
+
def get_strategy_max_drawdown(
|
3884
|
+
self,
|
3885
|
+
strategy_id: str,
|
3886
|
+
start_date: str,
|
3887
|
+
end_date: str,
|
3888
|
+
interval: str = "daily"
|
3889
|
+
) -> Dict[str, Any]:
|
3890
|
+
"""
|
3891
|
+
Get maximum drawdown for a strategy over a specified period.
|
3892
|
+
|
3893
|
+
Args:
|
3894
|
+
strategy_id (str): Strategy identifier.
|
3895
|
+
start_date (str): Start date (YYYY-MM-DD).
|
3896
|
+
end_date (str): End date (YYYY-MM-DD).
|
3897
|
+
interval (str): Time interval ('daily', 'weekly', 'monthly').
|
3898
|
+
|
3899
|
+
Returns:
|
3900
|
+
Dict[str, Any]: Strategy max drawdown data.
|
3901
|
+
|
3902
|
+
Example Response:
|
3903
|
+
{
|
3904
|
+
"strategyId": "str_01jspb8z36edjsp5pecqq0mpm3",
|
3905
|
+
"startDate": "2023-01-01",
|
3906
|
+
"endDate": "2024-12-31",
|
3907
|
+
"maxDrawdown": -0.15,
|
3908
|
+
"peakDate": "2023-06-15",
|
3909
|
+
"troughDate": "2023-09-20",
|
3910
|
+
"peakNav": 1.25,
|
3911
|
+
"troughNav": 1.06
|
3912
|
+
}
|
3913
|
+
"""
|
3914
|
+
params = self._normalize_params({
|
3915
|
+
"strategyId": strategy_id,
|
3916
|
+
"startDate": start_date,
|
3917
|
+
"endDate": end_date,
|
3918
|
+
"interval": interval
|
3919
|
+
})
|
3920
|
+
|
3921
|
+
logger.debug("Fetching max drawdown for strategy %s from %s to %s", strategy_id, start_date, end_date)
|
3922
|
+
return self._make_request("GET", self._routes["analytics.strategy.drawdown_max"], params=params)
|
3923
|
+
|
3924
|
+
def get_product_max_drawdown(
|
3925
|
+
self,
|
3926
|
+
product_id: str,
|
3927
|
+
start_date: str,
|
3928
|
+
end_date: str,
|
3929
|
+
interval: str = "daily"
|
3930
|
+
) -> Dict[str, Any]:
|
3931
|
+
"""
|
3932
|
+
Get maximum drawdown for a product over a specified period.
|
3933
|
+
|
3934
|
+
Args:
|
3935
|
+
product_id (str): Product identifier.
|
3936
|
+
start_date (str): Start date (YYYY-MM-DD).
|
3937
|
+
end_date (str): End date (YYYY-MM-DD).
|
3938
|
+
interval (str): Time interval ('daily', 'weekly', 'monthly').
|
3939
|
+
|
3940
|
+
Returns:
|
3941
|
+
Dict[str, Any]: Product max drawdown data.
|
3942
|
+
|
3943
|
+
Example Response:
|
3944
|
+
{
|
3945
|
+
"productId": "prd_01jyrg7ffkemq9hz3rkeznh9dr",
|
3946
|
+
"startDate": "2023-01-01",
|
3947
|
+
"endDate": "2024-12-31",
|
3948
|
+
"maxDrawdown": -0.12,
|
3949
|
+
"peakDate": "2023-05-10",
|
3950
|
+
"troughDate": "2023-08-15",
|
3951
|
+
"peakNav": 1.18,
|
3952
|
+
"troughNav": 1.04
|
3953
|
+
}
|
3954
|
+
"""
|
3955
|
+
params = self._normalize_params({
|
3956
|
+
"productId": product_id,
|
3957
|
+
"startDate": start_date,
|
3958
|
+
"endDate": end_date,
|
3959
|
+
"interval": interval
|
3960
|
+
})
|
3961
|
+
|
3962
|
+
logger.debug("Fetching max drawdown for product %s from %s to %s", product_id, start_date, end_date)
|
3963
|
+
return self._make_request("GET", self._routes["analytics.product.drawdown_max"], params=params)
|
3964
|
+
|
3965
|
+
def get_atr(
|
3966
|
+
self,
|
3967
|
+
symbol: str,
|
3968
|
+
start_date: str,
|
3969
|
+
end_date: str,
|
3970
|
+
window: int,
|
3971
|
+
adjusted: bool = True,
|
3972
|
+
interval: str = "daily"
|
3973
|
+
) -> Dict[str, Any]:
|
3974
|
+
"""
|
3975
|
+
Calculate Average True Range (ATR) for a security over a specified period.
|
3976
|
+
|
3977
|
+
Args:
|
3978
|
+
symbol (str): Stock symbol.
|
3979
|
+
start_date (str): Start date (YYYY-MM-DD).
|
3980
|
+
end_date (str): End date (YYYY-MM-DD).
|
3981
|
+
window (int): Lookback period (e.g., 14, 20).
|
3982
|
+
adjusted (bool): Adjust for splits/dividends.
|
3983
|
+
interval (str): Time interval ('daily', 'weekly', 'intraday').
|
3984
|
+
|
3985
|
+
Returns:
|
3986
|
+
Dict[str, Any]: ATR data.
|
3987
|
+
|
3988
|
+
Example Response:
|
3989
|
+
{
|
3990
|
+
"symbol": "AXISBANK",
|
3991
|
+
"startDate": "2023-01-01",
|
3992
|
+
"endDate": "2024-12-31",
|
3993
|
+
"window": 14,
|
3994
|
+
"adjusted": true,
|
3995
|
+
"atr": [
|
3996
|
+
{
|
3997
|
+
"date": "2023-01-15",
|
3998
|
+
"atrValue": 25.67
|
3999
|
+
}
|
4000
|
+
]
|
4001
|
+
}
|
4002
|
+
"""
|
4003
|
+
params = self._normalize_params({
|
4004
|
+
"symbol": symbol,
|
4005
|
+
"startDate": start_date,
|
4006
|
+
"endDate": end_date,
|
4007
|
+
"window": window,
|
4008
|
+
"adjusted": adjusted,
|
4009
|
+
"interval": interval
|
4010
|
+
})
|
4011
|
+
|
4012
|
+
logger.debug("Fetching ATR for %s with window %d from %s to %s", symbol, window, start_date, end_date)
|
4013
|
+
return self._make_request("GET", self._routes["analytics.volatility.atr"], params=params)
|
4014
|
+
|
4015
|
+
def get_simple_return(
|
4016
|
+
self,
|
4017
|
+
symbol: str,
|
4018
|
+
start_date: str,
|
4019
|
+
end_date: str,
|
4020
|
+
adjusted: bool = True,
|
4021
|
+
interval: str = "daily",
|
4022
|
+
benchmark: Optional[str] = None
|
4023
|
+
) -> Dict[str, Any]:
|
4024
|
+
"""
|
4025
|
+
Calculate simple return for a security or sectoral index.
|
4026
|
+
|
4027
|
+
Args:
|
4028
|
+
symbol (str): Stock/index symbol.
|
4029
|
+
start_date (str): Start date (YYYY-MM-DD).
|
4030
|
+
end_date (str): End date (YYYY-MM-DD).
|
4031
|
+
adjusted (bool): Adjust for corporate actions.
|
4032
|
+
interval (str): Time interval ('daily', 'weekly', 'monthly').
|
4033
|
+
benchmark (str, optional): Benchmark for relative return calculation.
|
4034
|
+
|
4035
|
+
Returns:
|
4036
|
+
Dict[str, Any]: Simple return data.
|
4037
|
+
|
4038
|
+
Example Response:
|
4039
|
+
{
|
4040
|
+
"symbol": "NIFTY IT",
|
4041
|
+
"startDate": "2023-01-01",
|
4042
|
+
"endDate": "2024-12-31",
|
4043
|
+
"adjusted": true,
|
4044
|
+
"totalReturn": 0.15,
|
4045
|
+
"startPrice": 1250.0,
|
4046
|
+
"endPrice": 1437.5,
|
4047
|
+
"benchmarkReturn": 0.12,
|
4048
|
+
"relativeReturn": 0.03,
|
4049
|
+
"unit": "decimal"
|
4050
|
+
}
|
4051
|
+
"""
|
4052
|
+
params = self._normalize_params({
|
4053
|
+
"symbol": symbol,
|
4054
|
+
"startDate": start_date,
|
4055
|
+
"endDate": end_date,
|
4056
|
+
"adjusted": adjusted,
|
4057
|
+
"interval": interval,
|
4058
|
+
"benchmark": benchmark
|
4059
|
+
})
|
4060
|
+
|
4061
|
+
logger.debug("Fetching simple return for %s from %s to %s", symbol, start_date, end_date)
|
4062
|
+
return self._make_request("GET", self._routes["analytics.returns.simple"], params=params)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: wiz_trader
|
3
|
-
Version: 0.
|
3
|
+
Version: 0.40.0
|
4
4
|
Summary: A Python SDK for connecting to the Wizzer.
|
5
5
|
Home-page: https://bitbucket.org/wizzer-tech/quotes_sdk.git
|
6
6
|
Author: Pawan Wagh
|
@@ -2834,10 +2834,52 @@ beta_custom = client.get_beta_custom_period(
|
|
2834
2834
|
)
|
2835
2835
|
print(f"Custom Period Beta: {beta_custom['beta']}")
|
2836
2836
|
print(f"Alpha: {beta_custom['alpha']}")
|
2837
|
+
|
2838
|
+
# Strategy Max Drawdown
|
2839
|
+
strategy_drawdown = client.get_strategy_max_drawdown(
|
2840
|
+
strategy_id="str_01jspb8z36edjsp5pecqq0mpm3",
|
2841
|
+
start_date="2023-01-01",
|
2842
|
+
end_date="2024-12-31",
|
2843
|
+
interval="daily"
|
2844
|
+
)
|
2845
|
+
print(f"Strategy Max Drawdown: {strategy_drawdown['maxDrawdown']}")
|
2846
|
+
print(f"Peak Date: {strategy_drawdown['peakDate']}")
|
2847
|
+
|
2848
|
+
# Product Max Drawdown
|
2849
|
+
product_drawdown = client.get_product_max_drawdown(
|
2850
|
+
product_id="prd_01jyrg7ffkemq9hz3rkeznh9dr",
|
2851
|
+
start_date="2023-01-01",
|
2852
|
+
end_date="2024-12-31",
|
2853
|
+
interval="monthly"
|
2854
|
+
)
|
2855
|
+
print(f"Product Max Drawdown: {product_drawdown['maxDrawdown']}")
|
2856
|
+
|
2857
|
+
# Average True Range (ATR)
|
2858
|
+
atr_data = client.get_atr(
|
2859
|
+
symbol="AXISBANK",
|
2860
|
+
start_date="2023-01-01",
|
2861
|
+
end_date="2024-12-31",
|
2862
|
+
window=14,
|
2863
|
+
adjusted=True,
|
2864
|
+
interval="daily"
|
2865
|
+
)
|
2866
|
+
print(f"Latest ATR: {atr_data['atr'][-1]['atrValue']}")
|
2867
|
+
|
2868
|
+
# Simple Return
|
2869
|
+
simple_return = client.get_simple_return(
|
2870
|
+
symbol="NIFTY_IT",
|
2871
|
+
start_date="2023-01-01",
|
2872
|
+
end_date="2024-12-31",
|
2873
|
+
adjusted=True,
|
2874
|
+
interval="daily",
|
2875
|
+
benchmark="NIFTY 50"
|
2876
|
+
)
|
2877
|
+
print(f"Total Return: {simple_return['totalReturn']}")
|
2878
|
+
print(f"Relative Return: {simple_return['relativeReturn']}")
|
2837
2879
|
```
|
2838
2880
|
|
2839
2881
|
**Key Features:**
|
2840
|
-
- **Comprehensive Coverage**:
|
2882
|
+
- **Comprehensive Coverage**: 43+ analytics endpoints covering fundamentals, valuation, returns, market data, ownership, metrics, macro data, risk analysis, sector classification, leverage analysis, and advanced technical analysis
|
2841
2883
|
- **Fundamentals Analysis**: 9 methods including ROE, ROA, margins, ratios, book-to-market, market cap-to-sales, and cash-to-market cap
|
2842
2884
|
- **Valuation Metrics**: P/E, P/B, EV/EBITDA, FCF yield with TTM and consolidated/standalone options
|
2843
2885
|
- **Risk-Adjusted Metrics**: Sortino ratio, upside capture ratio, maximum drawdown, and returns volatility for comprehensive risk analysis
|
@@ -0,0 +1,9 @@
|
|
1
|
+
wiz_trader/__init__.py,sha256=bog0Jn-YW5ETXusjmXX21JD2sh1K_WyEWszgbHfub_o,183
|
2
|
+
wiz_trader/apis/__init__.py,sha256=6sUr1nzmplNdld0zryMrQSt0jHT2GhOiFYgKKVHzk8U,133
|
3
|
+
wiz_trader/apis/client.py,sha256=sJe30lBXEVDrzTAlMOzAliWGRGEzRRy1lmuFgsQR7lQ,134159
|
4
|
+
wiz_trader/quotes/__init__.py,sha256=RF9g9CNP6bVWlmCh_ad8krm3-EWOIuVfLp0-H9fAeEM,108
|
5
|
+
wiz_trader/quotes/client.py,sha256=cAGaysLCljZilYgX8Sf3V88F6dWlcewJf6TMOpSKb7I,20862
|
6
|
+
wiz_trader-0.40.0.dist-info/METADATA,sha256=nokoCOhZLcliNLqhUSz0MB9PW-VZlW_2WbSwRZMey4w,172350
|
7
|
+
wiz_trader-0.40.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
8
|
+
wiz_trader-0.40.0.dist-info/top_level.txt,sha256=lnYS_g8LlA6ryKYnvY8xIQ6K2K-xzOsd-99AWgnW6VY,11
|
9
|
+
wiz_trader-0.40.0.dist-info/RECORD,,
|
@@ -1,9 +0,0 @@
|
|
1
|
-
wiz_trader/__init__.py,sha256=tGTxOYvxNnCM60gbqm1vUEVVPSwJenwhzcpX4_UVH6U,183
|
2
|
-
wiz_trader/apis/__init__.py,sha256=6sUr1nzmplNdld0zryMrQSt0jHT2GhOiFYgKKVHzk8U,133
|
3
|
-
wiz_trader/apis/client.py,sha256=BMjJbh6dgUsfm7rWpmOhzcGRSkSQmk_4WO8ewLN80Jw,128652
|
4
|
-
wiz_trader/quotes/__init__.py,sha256=RF9g9CNP6bVWlmCh_ad8krm3-EWOIuVfLp0-H9fAeEM,108
|
5
|
-
wiz_trader/quotes/client.py,sha256=cAGaysLCljZilYgX8Sf3V88F6dWlcewJf6TMOpSKb7I,20862
|
6
|
-
wiz_trader-0.39.0.dist-info/METADATA,sha256=TZaHzAX7bsObQveYYiN3lCJDyHoCxKGFStajdGk4g8g,171180
|
7
|
-
wiz_trader-0.39.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
8
|
-
wiz_trader-0.39.0.dist-info/top_level.txt,sha256=lnYS_g8LlA6ryKYnvY8xIQ6K2K-xzOsd-99AWgnW6VY,11
|
9
|
-
wiz_trader-0.39.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|