reportify-sdk 0.3.3__tar.gz → 0.3.4__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.
- {reportify_sdk-0.3.3/reportify_sdk.egg-info → reportify_sdk-0.3.4}/PKG-INFO +4 -4
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/README.md +3 -3
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/pyproject.toml +1 -1
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/__init__.py +1 -1
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/client.py +1 -1
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/quant.py +15 -15
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4/reportify_sdk.egg-info}/PKG-INFO +4 -4
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/LICENSE +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/agent.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/channels.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/chat.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/concepts.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/docs.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/exceptions.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/kb.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/search.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/stock.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/timeline.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk/user.py +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk.egg-info/SOURCES.txt +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk.egg-info/dependency_links.txt +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk.egg-info/requires.txt +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/reportify_sdk.egg-info/top_level.txt +0 -0
- {reportify_sdk-0.3.3 → reportify_sdk-0.3.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reportify-sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Python SDK for Reportify API - Financial data and document search
|
|
5
5
|
Author-email: Reportify <support@reportify.cn>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -133,7 +133,7 @@ df = client.quant.compute_indicators(["000001"], "MACD()")
|
|
|
133
133
|
|
|
134
134
|
# Screen stocks by formula
|
|
135
135
|
stocks = client.quant.screen(formula="RSI(14) < 30")
|
|
136
|
-
stocks = client.quant.screen(formula="CROSS(MA(5), MA(20))")
|
|
136
|
+
stocks = client.quant.screen(formula="CROSS(MA(CLOSE, 5), MA(CLOSE, 20))")
|
|
137
137
|
|
|
138
138
|
# Get OHLCV data
|
|
139
139
|
ohlcv = client.quant.ohlcv("000001", start_date="2024-01-01")
|
|
@@ -144,8 +144,8 @@ result = client.quant.backtest(
|
|
|
144
144
|
start_date="2023-01-01",
|
|
145
145
|
end_date="2024-01-01",
|
|
146
146
|
symbol="000001",
|
|
147
|
-
entry_formula="CROSS(MA(5), MA(20))",
|
|
148
|
-
exit_formula="CROSSDOWN(MA(5), MA(20))"
|
|
147
|
+
entry_formula="CROSS(MA(CLOSE, 5), MA(CLOSE, 20))",
|
|
148
|
+
exit_formula="CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))"
|
|
149
149
|
)
|
|
150
150
|
print(f"Total Return: {result['total_return_pct']:.2%}")
|
|
151
151
|
```
|
|
@@ -104,7 +104,7 @@ df = client.quant.compute_indicators(["000001"], "MACD()")
|
|
|
104
104
|
|
|
105
105
|
# Screen stocks by formula
|
|
106
106
|
stocks = client.quant.screen(formula="RSI(14) < 30")
|
|
107
|
-
stocks = client.quant.screen(formula="CROSS(MA(5), MA(20))")
|
|
107
|
+
stocks = client.quant.screen(formula="CROSS(MA(CLOSE, 5), MA(CLOSE, 20))")
|
|
108
108
|
|
|
109
109
|
# Get OHLCV data
|
|
110
110
|
ohlcv = client.quant.ohlcv("000001", start_date="2024-01-01")
|
|
@@ -115,8 +115,8 @@ result = client.quant.backtest(
|
|
|
115
115
|
start_date="2023-01-01",
|
|
116
116
|
end_date="2024-01-01",
|
|
117
117
|
symbol="000001",
|
|
118
|
-
entry_formula="CROSS(MA(5), MA(20))",
|
|
119
|
-
exit_formula="CROSSDOWN(MA(5), MA(20))"
|
|
118
|
+
entry_formula="CROSS(MA(CLOSE, 5), MA(CLOSE, 20))",
|
|
119
|
+
exit_formula="CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))"
|
|
120
120
|
)
|
|
121
121
|
print(f"Total Return: {result['total_return_pct']:.2%}")
|
|
122
122
|
```
|
|
@@ -39,7 +39,7 @@ class QuantModule:
|
|
|
39
39
|
"""
|
|
40
40
|
Get list of available technical indicators
|
|
41
41
|
|
|
42
|
-
All indicators are functions and require parentheses when used (e.g., MA(20), RSI(14), MACD()).
|
|
42
|
+
All indicators are functions and require parentheses when used (e.g., MA(CLOSE, 20), RSI(14), MACD()).
|
|
43
43
|
|
|
44
44
|
Returns:
|
|
45
45
|
List of indicator definitions with name, description, and fields
|
|
@@ -66,7 +66,7 @@ class QuantModule:
|
|
|
66
66
|
|
|
67
67
|
Variables vs Functions:
|
|
68
68
|
- Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME (aliases: C, O, H, L, V, VOL)
|
|
69
|
-
- Functions (
|
|
69
|
+
- Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), RSI(14), MACD(), etc.
|
|
70
70
|
|
|
71
71
|
Args:
|
|
72
72
|
symbols: List of stock codes (e.g., ["000001", "600519"])
|
|
@@ -117,7 +117,7 @@ class QuantModule:
|
|
|
117
117
|
|
|
118
118
|
Variables vs Functions:
|
|
119
119
|
- Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME, PE_TTM, ROE_TTM, etc.
|
|
120
|
-
- Functions (
|
|
120
|
+
- Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
121
121
|
|
|
122
122
|
Returns factors organized by level:
|
|
123
123
|
- Level 0 Variables: CLOSE, OPEN, HIGH, LOW, VOLUME (price data, no parentheses)
|
|
@@ -151,7 +151,7 @@ class QuantModule:
|
|
|
151
151
|
|
|
152
152
|
Variables vs Functions:
|
|
153
153
|
- Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
154
|
-
- Functions (
|
|
154
|
+
- Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
155
155
|
|
|
156
156
|
Args:
|
|
157
157
|
symbols: List of stock codes
|
|
@@ -171,10 +171,10 @@ class QuantModule:
|
|
|
171
171
|
>>> df = client.quant.compute_factors(["000001"], "MACD().dif")
|
|
172
172
|
|
|
173
173
|
>>> # Close above 20-day MA (boolean)
|
|
174
|
-
>>> df = client.quant.compute_factors(["000001"], "CLOSE > MA(20)")
|
|
174
|
+
>>> df = client.quant.compute_factors(["000001"], "CLOSE > MA(CLOSE, 20)")
|
|
175
175
|
|
|
176
176
|
>>> # Deviation from MA20 in percent
|
|
177
|
-
>>> df = client.quant.compute_factors(["000001"], "(CLOSE - MA(20)) / MA(20) * 100")
|
|
177
|
+
>>> df = client.quant.compute_factors(["000001"], "(CLOSE - MA(CLOSE, 20)) / MA(CLOSE, 20) * 100")
|
|
178
178
|
|
|
179
179
|
>>> # Fundamental factors (note: functions require parentheses)
|
|
180
180
|
>>> df = client.quant.compute_factors(["000001"], "PE()")
|
|
@@ -226,7 +226,7 @@ class QuantModule:
|
|
|
226
226
|
|
|
227
227
|
Variables vs Functions:
|
|
228
228
|
- Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
229
|
-
- Functions (
|
|
229
|
+
- Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
230
230
|
|
|
231
231
|
Args:
|
|
232
232
|
formula: Screening formula using Mai-language syntax
|
|
@@ -242,10 +242,10 @@ class QuantModule:
|
|
|
242
242
|
>>> stocks = client.quant.screen(formula="RSI(14) < 30")
|
|
243
243
|
|
|
244
244
|
>>> # Golden cross
|
|
245
|
-
>>> stocks = client.quant.screen(formula="CROSS(MA(5), MA(10))")
|
|
245
|
+
>>> stocks = client.quant.screen(formula="CROSS(MA(CLOSE, 5), MA(CLOSE, 10))")
|
|
246
246
|
|
|
247
247
|
>>> # Uptrend
|
|
248
|
-
>>> stocks = client.quant.screen(formula="(CLOSE > MA(20)) & (MA(20) > MA(60))")
|
|
248
|
+
>>> stocks = client.quant.screen(formula="(CLOSE > MA(CLOSE, 20)) & (MA(CLOSE, 20) > MA(CLOSE, 60))")
|
|
249
249
|
|
|
250
250
|
>>> # Above upper Bollinger Band
|
|
251
251
|
>>> stocks = client.quant.screen(formula="CLOSE > BOLL(20, 2).upper")
|
|
@@ -372,7 +372,7 @@ class QuantModule:
|
|
|
372
372
|
|
|
373
373
|
Variables vs Functions:
|
|
374
374
|
- Variables (no parentheses): CLOSE, OPEN, HIGH, LOW, VOLUME
|
|
375
|
-
- Functions (
|
|
375
|
+
- Functions (TongDaXin style: col first, n second): MA(CLOSE, 20), PE(), ROE(), RSI(14), etc.
|
|
376
376
|
|
|
377
377
|
Args:
|
|
378
378
|
start_date: Backtest start date (YYYY-MM-DD)
|
|
@@ -386,7 +386,7 @@ class QuantModule:
|
|
|
386
386
|
stop_loss: Stop loss setting (default: 0.0, no stop loss)
|
|
387
387
|
sizer_percent: Position percentage (default: 99%)
|
|
388
388
|
auto_close: Auto close positions (default: True)
|
|
389
|
-
labels: Label dict for returning extra indicator values, e.g. {"up": "CROSS(MA(20), MA(60))"}
|
|
389
|
+
labels: Label dict for returning extra indicator values, e.g. {"up": "CROSS(MA(CLOSE, 20), MA(CLOSE, 60))"}
|
|
390
390
|
|
|
391
391
|
Returns:
|
|
392
392
|
Backtest results including:
|
|
@@ -407,7 +407,7 @@ class QuantModule:
|
|
|
407
407
|
... start_date="2023-01-01",
|
|
408
408
|
... end_date="2024-01-01",
|
|
409
409
|
... symbol="000001",
|
|
410
|
-
... entry_formula="CROSS(MA(5), MA(20))", # Buy when MA5 crosses above MA20
|
|
410
|
+
... entry_formula="CROSS(MA(CLOSE, 5), MA(CLOSE, 20))", # Buy when MA5 crosses above MA20
|
|
411
411
|
... initial_cash=100000
|
|
412
412
|
... )
|
|
413
413
|
>>> print(f"Total Return: {result['total_return_pct']:.2%}")
|
|
@@ -419,8 +419,8 @@ class QuantModule:
|
|
|
419
419
|
... start_date="2023-01-01",
|
|
420
420
|
... end_date="2024-01-01",
|
|
421
421
|
... symbol="000001",
|
|
422
|
-
... entry_formula="CROSS(MA(5), MA(20))", # Buy signal
|
|
423
|
-
... exit_formula="CROSSDOWN(MA(5), MA(20))" # Sell signal
|
|
422
|
+
... entry_formula="CROSS(MA(CLOSE, 5), MA(CLOSE, 20))", # Buy signal
|
|
423
|
+
... exit_formula="CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))" # Sell signal
|
|
424
424
|
... )
|
|
425
425
|
|
|
426
426
|
>>> # Fundamental screening backtest (note: functions require parentheses)
|
|
@@ -438,7 +438,7 @@ class QuantModule:
|
|
|
438
438
|
... symbol="000001",
|
|
439
439
|
... entry_formula="RSI(14) < 30",
|
|
440
440
|
... exit_formula="RSI(14) > 70",
|
|
441
|
-
... labels={"rsi": "RSI(14)", "ma20": "MA(20)"}
|
|
441
|
+
... labels={"rsi": "RSI(14)", "ma20": "MA(CLOSE, 20)"}
|
|
442
442
|
... )
|
|
443
443
|
"""
|
|
444
444
|
data = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: reportify-sdk
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.4
|
|
4
4
|
Summary: Python SDK for Reportify API - Financial data and document search
|
|
5
5
|
Author-email: Reportify <support@reportify.cn>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -133,7 +133,7 @@ df = client.quant.compute_indicators(["000001"], "MACD()")
|
|
|
133
133
|
|
|
134
134
|
# Screen stocks by formula
|
|
135
135
|
stocks = client.quant.screen(formula="RSI(14) < 30")
|
|
136
|
-
stocks = client.quant.screen(formula="CROSS(MA(5), MA(20))")
|
|
136
|
+
stocks = client.quant.screen(formula="CROSS(MA(CLOSE, 5), MA(CLOSE, 20))")
|
|
137
137
|
|
|
138
138
|
# Get OHLCV data
|
|
139
139
|
ohlcv = client.quant.ohlcv("000001", start_date="2024-01-01")
|
|
@@ -144,8 +144,8 @@ result = client.quant.backtest(
|
|
|
144
144
|
start_date="2023-01-01",
|
|
145
145
|
end_date="2024-01-01",
|
|
146
146
|
symbol="000001",
|
|
147
|
-
entry_formula="CROSS(MA(5), MA(20))",
|
|
148
|
-
exit_formula="CROSSDOWN(MA(5), MA(20))"
|
|
147
|
+
entry_formula="CROSS(MA(CLOSE, 5), MA(CLOSE, 20))",
|
|
148
|
+
exit_formula="CROSSDOWN(MA(CLOSE, 5), MA(CLOSE, 20))"
|
|
149
149
|
)
|
|
150
150
|
print(f"Total Return: {result['total_return_pct']:.2%}")
|
|
151
151
|
```
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|