asrquant 1.0.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.
- asrquant/__init__.py +230 -0
- asrquant/__main__.py +3 -0
- asrquant/api.py +748 -0
- asrquant/approximation.py +294 -0
- asrquant/audit.py +72 -0
- asrquant/audit_store.py +356 -0
- asrquant/backtest.py +194 -0
- asrquant/cli.py +394 -0
- asrquant/config.py +117 -0
- asrquant/data.py +192 -0
- asrquant/derivatives.py +305 -0
- asrquant/easy.py +252 -0
- asrquant/fixed_income.py +149 -0
- asrquant/literature.py +536 -0
- asrquant/live.py +897 -0
- asrquant/machine_learning.py +178 -0
- asrquant/martingales.py +74 -0
- asrquant/math.py +88 -0
- asrquant/metrics.py +323 -0
- asrquant/models.py +239 -0
- asrquant/monte_carlo.py +502 -0
- asrquant/optimization.py +223 -0
- asrquant/production.py +475 -0
- asrquant/provenance.py +47 -0
- asrquant/providers.py +282 -0
- asrquant/report.py +68 -0
- asrquant/research.py +81 -0
- asrquant/simulation.py +419 -0
- asrquant/statistics.py +375 -0
- asrquant/strategies.py +177 -0
- asrquant/surfaces.py +803 -0
- asrquant/trading.py +363 -0
- asrquant/validation.py +99 -0
- asrquant/version.py +2 -0
- asrquant/viz/__init__.py +16 -0
- asrquant/viz/base.py +58 -0
- asrquant/viz/derivatives.py +182 -0
- asrquant/viz/general.py +204 -0
- asrquant/viz/market.py +306 -0
- asrquant/viz/microstructure.py +137 -0
- asrquant/viz/ml.py +159 -0
- asrquant/viz/performance.py +171 -0
- asrquant/viz/portfolio.py +151 -0
- asrquant/viz/regression.py +153 -0
- asrquant/viz/risk.py +182 -0
- asrquant/viz/simulation.py +135 -0
- asrquant/volatility.py +70 -0
- asrquant/workflow.py +1074 -0
- asrquant-1.0.0.dist-info/METADATA +3849 -0
- asrquant-1.0.0.dist-info/RECORD +54 -0
- asrquant-1.0.0.dist-info/WHEEL +5 -0
- asrquant-1.0.0.dist-info/entry_points.txt +2 -0
- asrquant-1.0.0.dist-info/licenses/LICENSE +21 -0
- asrquant-1.0.0.dist-info/top_level.txt +1 -0
asrquant/__init__.py
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
"""ASRQuant: auditable end-to-end quantitative research in Python."""
|
|
2
|
+
from .api import QuantLab
|
|
3
|
+
from .audit import AuditResult, implementation_audit
|
|
4
|
+
from .backtest import BacktestResult, compare_backtests, run_backtest
|
|
5
|
+
from .config import BacktestSpec, CostModel, MissingDataPolicy, PlotConfig
|
|
6
|
+
from .data import (
|
|
7
|
+
clean_prices,
|
|
8
|
+
data_fingerprint,
|
|
9
|
+
data_quality_report,
|
|
10
|
+
load_prices,
|
|
11
|
+
load_sql,
|
|
12
|
+
log_returns,
|
|
13
|
+
resample_ohlcv,
|
|
14
|
+
simple_returns,
|
|
15
|
+
)
|
|
16
|
+
from .derivatives import (
|
|
17
|
+
OptionPrice,
|
|
18
|
+
bachelier_greeks,
|
|
19
|
+
bachelier_price,
|
|
20
|
+
black76_price,
|
|
21
|
+
black_scholes_greeks,
|
|
22
|
+
black_scholes_price,
|
|
23
|
+
crr_binomial_price,
|
|
24
|
+
implied_volatility,
|
|
25
|
+
price_option,
|
|
26
|
+
)
|
|
27
|
+
from .machine_learning import (
|
|
28
|
+
WalkForwardMLResult,
|
|
29
|
+
forward_target,
|
|
30
|
+
lag_features,
|
|
31
|
+
technical_features,
|
|
32
|
+
walk_forward_fit,
|
|
33
|
+
resolve_estimator,
|
|
34
|
+
)
|
|
35
|
+
from .martingales import MartingaleResult, discount_process, martingale_diagnostics
|
|
36
|
+
from .fixed_income import bond_price, bootstrap_zero_curve, convexity, macaulay_duration, modified_duration, yield_to_maturity, zero_coupon_price
|
|
37
|
+
from .volatility import VolatilityForecast, ewma_volatility, garch_forecast, garman_klass_volatility, parkinson_volatility, realized_volatility
|
|
38
|
+
from .metrics import summary_metrics
|
|
39
|
+
from .statistics import autoregression_fit
|
|
40
|
+
from .models import ModelFactory, models, create as create_model
|
|
41
|
+
from .easy import PlotHandle, date_range, fit, frame, open_lab, read_table, report, save, series, show, visualize
|
|
42
|
+
from . import math
|
|
43
|
+
from . import statistics as stats
|
|
44
|
+
from . import research
|
|
45
|
+
from . import trading
|
|
46
|
+
from . import optimization as portfolio
|
|
47
|
+
from . import viz as visuals
|
|
48
|
+
from . import derivatives as options
|
|
49
|
+
from . import simulation as stochastic
|
|
50
|
+
from . import monte_carlo as mc
|
|
51
|
+
from . import approximation as approx
|
|
52
|
+
from . import fixed_income as rates
|
|
53
|
+
from . import volatility as vol
|
|
54
|
+
from .provenance import build_manifest
|
|
55
|
+
from .literature import (
|
|
56
|
+
HypothesisCandidate,
|
|
57
|
+
HypothesisRegistry,
|
|
58
|
+
LiteratureCorpus,
|
|
59
|
+
PaperDocument,
|
|
60
|
+
SourceExcerpt,
|
|
61
|
+
)
|
|
62
|
+
from .workflow import (
|
|
63
|
+
DataPlan,
|
|
64
|
+
DataRequirement,
|
|
65
|
+
DecisionResult,
|
|
66
|
+
EconomicHypothesis,
|
|
67
|
+
FeaturePlan,
|
|
68
|
+
FeatureSpec,
|
|
69
|
+
PortfolioSpec,
|
|
70
|
+
HypothesisTestResult,
|
|
71
|
+
ResearchProject,
|
|
72
|
+
RobustnessResult,
|
|
73
|
+
SignalSpec,
|
|
74
|
+
autoresearch,
|
|
75
|
+
research_project,
|
|
76
|
+
)
|
|
77
|
+
from .trading import (
|
|
78
|
+
BrokerAdapter,
|
|
79
|
+
Fill,
|
|
80
|
+
Order,
|
|
81
|
+
OrderSide,
|
|
82
|
+
OrderStatus,
|
|
83
|
+
OrderType,
|
|
84
|
+
PaperBroker,
|
|
85
|
+
PaperTrader,
|
|
86
|
+
PaperTradingResult,
|
|
87
|
+
RiskPolicy,
|
|
88
|
+
paper_trade,
|
|
89
|
+
)
|
|
90
|
+
from .providers import (
|
|
91
|
+
AlphaVantageProvider,
|
|
92
|
+
BinanceProvider,
|
|
93
|
+
FREDProvider,
|
|
94
|
+
MarketDataProvider,
|
|
95
|
+
PollingFeed,
|
|
96
|
+
YahooProvider,
|
|
97
|
+
download,
|
|
98
|
+
get_provider,
|
|
99
|
+
)
|
|
100
|
+
from .surfaces import SurfaceResult, evaluate_surface, evaluate_surface_animation, evaluate_parameter_surface, surface_from_dataframe
|
|
101
|
+
from .monte_carlo import (
|
|
102
|
+
MonteCarloResult,
|
|
103
|
+
correlated_normal,
|
|
104
|
+
empirical_quantile,
|
|
105
|
+
euler_maruyama,
|
|
106
|
+
event_probability,
|
|
107
|
+
expected_shortfall as monte_carlo_expected_shortfall,
|
|
108
|
+
hedging_loss,
|
|
109
|
+
mean_confidence_interval,
|
|
110
|
+
monte_carlo_parameter_surface,
|
|
111
|
+
normal_samples,
|
|
112
|
+
proportional_transaction_cost,
|
|
113
|
+
run_monte_carlo,
|
|
114
|
+
sample_variance,
|
|
115
|
+
standard_error,
|
|
116
|
+
uniform_inverse_transform,
|
|
117
|
+
value_at_risk as monte_carlo_value_at_risk,
|
|
118
|
+
)
|
|
119
|
+
from .approximation import (
|
|
120
|
+
ApproximationResult,
|
|
121
|
+
bilinear_interpolation,
|
|
122
|
+
cubic_spline,
|
|
123
|
+
finite_difference_gradient,
|
|
124
|
+
finite_difference_hessian,
|
|
125
|
+
gaussian_process,
|
|
126
|
+
kernel_regression,
|
|
127
|
+
linear_interpolation,
|
|
128
|
+
rbf_interpolation,
|
|
129
|
+
regression_metrics,
|
|
130
|
+
response_regression,
|
|
131
|
+
surface_gradient,
|
|
132
|
+
surface_hessian,
|
|
133
|
+
)
|
|
134
|
+
from .simulation import (
|
|
135
|
+
MonteCarloPriceResult,
|
|
136
|
+
SimulationResult,
|
|
137
|
+
arithmetic_brownian_motion,
|
|
138
|
+
asian_option_mc,
|
|
139
|
+
cir_process,
|
|
140
|
+
european_option_mc,
|
|
141
|
+
geometric_brownian_motion,
|
|
142
|
+
correlated_gbm,
|
|
143
|
+
regime_switching_prices,
|
|
144
|
+
heston_process,
|
|
145
|
+
merton_jump_diffusion,
|
|
146
|
+
monte_carlo_price,
|
|
147
|
+
ornstein_uhlenbeck,
|
|
148
|
+
simulate,
|
|
149
|
+
simulate_gbm,
|
|
150
|
+
stationary_bootstrap,
|
|
151
|
+
vasicek_process,
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
from .production import (
|
|
156
|
+
CheckLevel,
|
|
157
|
+
CheckState,
|
|
158
|
+
ReadinessCheck,
|
|
159
|
+
ProductionReadinessReport,
|
|
160
|
+
DeploymentEvidence,
|
|
161
|
+
ProductionReadinessGate,
|
|
162
|
+
DeploymentCertificate,
|
|
163
|
+
)
|
|
164
|
+
from .audit_store import AuditEvent, SQLiteAuditStore
|
|
165
|
+
from .live import (
|
|
166
|
+
BrokerEnvironment,
|
|
167
|
+
HealthState,
|
|
168
|
+
ReconciliationState,
|
|
169
|
+
BrokerCredentials,
|
|
170
|
+
AccountSnapshot,
|
|
171
|
+
PositionSnapshot,
|
|
172
|
+
BrokerOrderReceipt,
|
|
173
|
+
MarketDataSnapshot,
|
|
174
|
+
BrokerHealth,
|
|
175
|
+
RiskDecision,
|
|
176
|
+
ReconciliationReport,
|
|
177
|
+
LiveRiskPolicy,
|
|
178
|
+
ExecutionBroker,
|
|
179
|
+
AlpacaBroker,
|
|
180
|
+
PersistentKillSwitch,
|
|
181
|
+
PreTradeRiskEngine,
|
|
182
|
+
LiveTradingEngine,
|
|
183
|
+
)
|
|
184
|
+
|
|
185
|
+
from .version import __version__
|
|
186
|
+
|
|
187
|
+
__all__ = [
|
|
188
|
+
"__version__", "QuantLab", "BacktestSpec", "CostModel", "MissingDataPolicy", "PlotConfig",
|
|
189
|
+
"ModelFactory", "models", "create_model", "PlotHandle", "visualize", "show", "save", "report", "fit",
|
|
190
|
+
"open_lab", "frame", "series", "read_table", "date_range", "math", "stats", "portfolio", "visuals",
|
|
191
|
+
"options", "stochastic", "mc", "approx", "rates", "vol", "research", "trading",
|
|
192
|
+
"BacktestResult", "AuditResult", "run_backtest", "compare_backtests", "implementation_audit",
|
|
193
|
+
"clean_prices", "simple_returns", "log_returns", "load_prices", "load_sql",
|
|
194
|
+
"resample_ohlcv", "data_quality_report", "data_fingerprint", "summary_metrics", "autoregression_fit", "build_manifest",
|
|
195
|
+
"OptionPrice", "black_scholes_price", "black_scholes_greeks", "bachelier_price",
|
|
196
|
+
"bachelier_greeks", "black76_price", "crr_binomial_price", "implied_volatility", "price_option",
|
|
197
|
+
"SurfaceResult", "evaluate_surface", "evaluate_surface_animation", "evaluate_parameter_surface", "surface_from_dataframe",
|
|
198
|
+
"SimulationResult", "MonteCarloPriceResult", "simulate", "simulate_gbm",
|
|
199
|
+
"arithmetic_brownian_motion", "geometric_brownian_motion", "correlated_gbm", "regime_switching_prices", "ornstein_uhlenbeck",
|
|
200
|
+
"cir_process", "vasicek_process", "heston_process", "merton_jump_diffusion", "stationary_bootstrap",
|
|
201
|
+
"monte_carlo_price", "european_option_mc", "asian_option_mc",
|
|
202
|
+
"MonteCarloResult", "run_monte_carlo", "empirical_quantile", "event_probability",
|
|
203
|
+
"sample_variance", "standard_error", "mean_confidence_interval",
|
|
204
|
+
"monte_carlo_value_at_risk", "monte_carlo_expected_shortfall",
|
|
205
|
+
"uniform_inverse_transform", "normal_samples", "correlated_normal", "euler_maruyama",
|
|
206
|
+
"proportional_transaction_cost", "hedging_loss", "monte_carlo_parameter_surface",
|
|
207
|
+
"ApproximationResult", "linear_interpolation", "bilinear_interpolation", "cubic_spline",
|
|
208
|
+
"kernel_regression", "rbf_interpolation", "gaussian_process", "response_regression",
|
|
209
|
+
"regression_metrics", "finite_difference_gradient", "finite_difference_hessian",
|
|
210
|
+
"surface_gradient", "surface_hessian",
|
|
211
|
+
"MartingaleResult", "discount_process", "martingale_diagnostics",
|
|
212
|
+
"WalkForwardMLResult", "lag_features", "technical_features", "forward_target", "walk_forward_fit", "resolve_estimator",
|
|
213
|
+
"MarketDataProvider", "AlphaVantageProvider", "BinanceProvider", "FREDProvider", "YahooProvider",
|
|
214
|
+
"PollingFeed", "download", "get_provider",
|
|
215
|
+
"zero_coupon_price", "bond_price", "yield_to_maturity", "macaulay_duration", "modified_duration", "convexity", "bootstrap_zero_curve",
|
|
216
|
+
"VolatilityForecast", "realized_volatility", "parkinson_volatility", "garman_klass_volatility", "ewma_volatility", "garch_forecast",
|
|
217
|
+
"SourceExcerpt", "PaperDocument", "HypothesisCandidate", "HypothesisRegistry", "LiteratureCorpus",
|
|
218
|
+
"DataRequirement", "DataPlan", "EconomicHypothesis", "FeatureSpec", "FeaturePlan", "SignalSpec",
|
|
219
|
+
"PortfolioSpec", "HypothesisTestResult", "RobustnessResult", "DecisionResult", "ResearchProject", "research_project", "autoresearch",
|
|
220
|
+
"OrderSide", "OrderType", "OrderStatus", "Order", "Fill", "RiskPolicy", "BrokerAdapter",
|
|
221
|
+
"PaperBroker", "PaperTrader", "PaperTradingResult", "paper_trade",
|
|
222
|
+
"CheckLevel", "CheckState", "ReadinessCheck", "ProductionReadinessReport",
|
|
223
|
+
"DeploymentEvidence", "ProductionReadinessGate", "DeploymentCertificate",
|
|
224
|
+
"AuditEvent", "SQLiteAuditStore",
|
|
225
|
+
"BrokerEnvironment", "HealthState", "ReconciliationState", "BrokerCredentials",
|
|
226
|
+
"AccountSnapshot", "PositionSnapshot", "BrokerOrderReceipt", "MarketDataSnapshot",
|
|
227
|
+
"BrokerHealth", "RiskDecision", "ReconciliationReport", "LiveRiskPolicy",
|
|
228
|
+
"ExecutionBroker", "AlpacaBroker", "PersistentKillSwitch", "PreTradeRiskEngine",
|
|
229
|
+
"LiveTradingEngine",
|
|
230
|
+
]
|
asrquant/__main__.py
ADDED