SPB Git

Repository Public

quant-tools-next.json 48.6 KB 1 lines json

1{"tools":[{"id":"garch","title":"GARCH volatility","summary":"Estimates a GARCH(p,q) model on daily returns and forecasts conditional volatility.","params":[{"name":"symbol","type":"symbol","label":"Symbol","required":true},{"name":"p","type":"int","label":"p (GARCH lags)","default":1,"min":1,"max":5},{"name":"q","type":"int","label":"q (ARCH lags)","default":1,"min":1,"max":5},{"name":"forecast_horizon","type":"int","label":"Forecast horizon (days)","default":30,"min":1,"max":252},{"name":"data_period","type":"int","label":"History (trading days)","default":504,"min":30,"max":2520}],"category":"volatility","version":"1.0.0","resultSchema":"legacy"},{"id":"var","title":"Value at Risk","summary":"Historical, parametric and Monte Carlo VaR and expected shortfall of a position.","params":[{"name":"symbol","type":"symbol","label":"Symbol","required":true},{"name":"portfolio_value","type":"number","label":"Position value","default":100000,"min":1,"max":1000000000000},{"name":"confidence_levels","type":"numbers","label":"Confidence levels","default":[0.9,0.95,0.99],"min":0.5,"max":0.9999},{"name":"time_horizon","type":"int","label":"Horizon (days)","default":1,"min":1,"max":252},{"name":"num_simulations","type":"int","label":"Simulations","default":10000,"min":1000,"max":100000},{"name":"data_period","type":"int","label":"History (trading days)","default":504,"min":30,"max":2520}],"category":"risk","version":"1.0.0","resultSchema":"legacy"},{"id":"monte_carlo","title":"Monte Carlo simulation","summary":"Simulates price paths from the historical drift and volatility of a symbol.","params":[{"name":"symbol","type":"symbol","label":"Symbol","required":true},{"name":"num_simulations","type":"int","label":"Simulations","default":10000,"min":100,"max":100000},{"name":"time_horizon","type":"int","label":"Horizon (trading days)","default":252,"min":1,"max":2520},{"name":"initial_investment","type":"number","label":"Initial investment","default":10000,"min":1,"max":1000000000000}],"category":"simulation","version":"1.0.0","resultSchema":"legacy"},{"id":"options","title":"Option pricing","summary":"Black-Scholes price and Greeks of a European call and put; spot and volatility come from the symbol unless given.","params":[{"name":"symbol","type":"symbol","label":"Symbol","required":true},{"name":"strike_price","type":"number","label":"Strike","required":true,"min":0.0001,"max":1000000000},{"name":"time_to_maturity","type":"number","label":"Time to maturity (years)","required":true,"min":0.0001,"max":30},{"name":"risk_free_rate","type":"number","label":"Risk-free rate","default":0.05,"min":-0.05,"max":0.5},{"name":"volatility","type":"number","label":"Volatility (annualised, optional)","min":0.0001,"max":10},{"name":"option_type","type":"choice","label":"Type","default":"call","choices":["call","put"]}],"category":"options","version":"1.0.0","resultSchema":"legacy"},{"id":"portfolio_optimization","title":"Portfolio optimisation","summary":"Mean-variance optimisation: maximum Sharpe, minimum variance and the efficient frontier.","params":[{"name":"symbols","type":"symbols","label":"Symbols","required":true,"min":2,"max":30},{"name":"risk_free_rate","type":"number","label":"Risk-free rate","default":0.02,"min":-0.05,"max":0.5},{"name":"min_weight","type":"number","label":"Minimum weight","default":0,"min":0,"max":1},{"name":"max_weight","type":"number","label":"Maximum weight","default":1,"min":0,"max":1},{"name":"data_period","type":"int","label":"History (trading days)","default":504,"min":30,"max":2520},{"name":"generate_frontier","type":"bool","label":"Efficient frontier","default":true},{"name":"frontier_points","type":"int","label":"Frontier points","default":50,"min":5,"max":200}],"category":"portfolio","version":"1.0.0","resultSchema":"legacy"},{"id":"risk_metrics","title":"Risk metrics","summary":"Sharpe, Sortino, beta, alpha, drawdown and related measures against a benchmark.","params":[{"name":"symbol","type":"symbol","label":"Symbol","required":true},{"name":"benchmark_symbol","type":"symbol","label":"Benchmark","default":"SPY"},{"name":"risk_free_rate","type":"number","label":"Risk-free rate","default":0.02,"min":-0.05,"max":0.5},{"name":"data_period","type":"int","label":"History (trading days)","default":504,"min":30,"max":2520}],"category":"risk","version":"1.0.0","resultSchema":"legacy"},{"id":"volatility_lab","title":"Volatility Lab","summary":"Conditional volatility (EWMA, GARCH, GJR, EGARCH), range-based and realized estimators, HAR-RV, forecasts with term structure, and an out-of-sample comparison of specifications.","params":[{"name":"symbol","label":"Symbol","required":true,"group":"Data","type":"symbol"},{"name":"period_days","label":"History (trading days)","group":"Data","help":"Number of most recent sessions to use when no start date is given (1260 ≈ 5 years).","type":"int","min":60,"max":10000,"default":1260},{"name":"start","label":"Start date","group":"Data","help":"Optional. Overrides the history length.","type":"date"},{"name":"end","label":"End date","group":"Data","help":"Optional. Defaults to the latest available session.","type":"date"},{"name":"model","label":"Model","group":"Model","help":"garch = GARCH(p,q); gjr = GJR-GARCH (leverage through an indicator); egarch = exponential GARCH; ewma = RiskMetrics.","type":"choice","choices":["garch","gjr","egarch","ewma"],"default":"garch"},{"name":"p","label":"ARCH order p","group":"Model","type":"int","min":1,"max":3,"default":1},{"name":"q","label":"GARCH order q","group":"Model","type":"int","min":1,"max":3,"default":1},{"name":"o","label":"Asymmetry order o","group":"Model","help":"Used by gjr and egarch only.","type":"int","min":1,"max":2,"default":1},{"name":"distribution","label":"Error distribution","group":"Model","type":"choice","choices":["normal","t","skewt"],"default":"t"},{"name":"mean","label":"Mean equation","group":"Model","type":"choice","choices":["constant","zero","ar1"],"default":"constant"},{"name":"ewma_lambda","label":"EWMA decay λ","group":"Model","help":"RiskMetrics uses 0.94 for daily data.","type":"number","min":0.5,"max":0.999,"default":0.94},{"name":"ewma_estimate","label":"Estimate λ by Gaussian QML","group":"Model","type":"bool","default":false},{"name":"horizon","label":"Forecast horizon (days)","group":"Forecast","type":"int","min":1,"max":252,"default":21},{"name":"compare","label":"Compare specifications","group":"Comparison","help":"Ranks several specifications by information criteria and by one-step-ahead forecast accuracy on a hold-out.","type":"bool","default":false},{"name":"compare_specs","label":"Specifications to compare","group":"Comparison","help":"Comma-separated model[:distribution] with model in garch|gjr|egarch|ewma and distribution in normal|t|skewt.","type":"text","maxLength":2000,"default":"ewma, garch:normal, garch:t, gjr:t, egarch:t"},{"name":"holdout","label":"Hold-out (days)","group":"Comparison","type":"int","min":30,"max":2000,"default":250},{"name":"scheme","label":"Re-estimation window","group":"Comparison","type":"choice","choices":["expanding","rolling"],"default":"expanding"},{"name":"refit_every","label":"Refit every (days)","group":"Comparison","help":"Parameters are re-estimated every this many days; in between, the variance is filtered with fixed parameters.","type":"int","min":1,"max":250,"default":21},{"name":"proxy","label":"Realized-variance proxy","group":"Comparison","help":"squared_return: unbiased but noisy; range: squared overnight return + Garman-Klass; realized: intraday realized variance + squared overnight return (needs an intraday interval).","type":"choice","choices":["squared_return","range","realized"],"default":"squared_return"},{"name":"range_window","label":"Range-estimator window (days)","group":"Realized measures","type":"int","min":5,"max":252,"default":21},{"name":"realized_interval","label":"Intraday interval for realized volatility","group":"Realized measures","type":"choice","choices":["none","5m","15m","30m","1h"],"default":"none"},{"name":"realized_days","label":"Intraday history (days)","group":"Realized measures","type":"int","min":60,"max":1260,"default":250},{"name":"har","label":"Fit HAR-RV","group":"Realized measures","type":"bool","default":true},{"name":"har_source","label":"HAR series","group":"Realized measures","help":"auto = intraday realized variance when available, otherwise the Garman-Klass daily variance.","type":"choice","choices":["auto","realized","garman_klass","parkinson","rogers_satchell"],"default":"auto"},{"name":"har_log","label":"HAR in logs","group":"Realized measures","type":"bool","default":false},{"name":"seed","label":"Random seed","group":"Advanced","type":"int","min":0,"max":2147483647,"default":12345}],"category":"volatility","version":"1.0.0","resultSchema":"lab/1"},{"id":"risk_lab","title":"Risk Lab","summary":"Value-at-Risk and Expected Shortfall by six methods, VaR backtesting, drawdowns, historical stress replays and hypothetical shocks, correlation dynamics and tail diagnostics for an asset or a weighted portfolio.","params":[{"name":"symbols","label":"Symbols","required":true,"group":"Portfolio","help":"One symbol for a single asset, several for a portfolio.","type":"symbols","min":1,"max":20},{"name":"weights","label":"Weights","group":"Portfolio","help":"Same order as the symbols; rescaled to sum to 1. Empty = equal weights. Negative = short.","type":"numbers","min":-10,"max":10,"maxItems":100},{"name":"period_days","label":"History (trading days)","group":"Data","help":"2520 ≈ 10 years. Stress replays need a sample that covers the episode (the 2008 crisis needs about 4 800 days).","type":"int","min":120,"max":10000,"default":2520},{"name":"start","label":"Start date","group":"Data","help":"Optional. Overrides the history length.","type":"date"},{"name":"end","label":"End date","group":"Data","help":"Optional. Defaults to the latest available session.","type":"date"},{"name":"confidence_levels","label":"Confidence levels","group":"VaR","type":"numbers","min":0.5,"max":0.9999,"maxItems":100,"default":[0.95,0.99]},{"name":"horizons","label":"Horizons (days)","group":"VaR","type":"numbers","min":1,"max":250,"maxItems":100,"default":[1,10]},{"name":"fhs_model","label":"Filter for filtered historical simulation","group":"VaR","type":"choice","choices":["garch","gjr"],"default":"garch"},{"name":"mc_distribution","label":"Monte Carlo distribution","group":"VaR","type":"choice","choices":["normal","student_t"],"default":"student_t"},{"name":"simulations","label":"Simulated paths","group":"VaR","type":"int","min":1000,"max":200000,"default":20000},{"name":"backtest_window","label":"Backtest estimation window (days)","group":"Backtest","type":"int","min":60,"max":2000,"default":250},{"name":"shocks","label":"Hypothetical shocks","group":"Stress","help":"Returns applied to factors or to portfolio assets (fractions: -0.20 = −20 %). Other assets move by their sample betas to the shocked series.","type":"json","maxBytes":65536,"schemaHint":"{\"SPY\": -0.20, \"TLT\": 0.05}  or  {\"Equity crash\": {\"SPY\": -0.20}, \"Rates up\": {\"TLT\": -0.10}}"},{"name":"corr_window","label":"Rolling correlation window (days)","group":"Correlation","type":"int","min":20,"max":504,"default":63},{"name":"corr_lambda","label":"EWMA correlation decay λ","group":"Correlation","type":"number","min":0.8,"max":0.999,"default":0.94},{"name":"seed","label":"Random seed","group":"Advanced","type":"int","min":0,"max":2147483647,"default":12345}],"category":"risk","version":"1.0.0","resultSchema":"lab/1"},{"id":"regression","title":"Regression","summary":"OLS, WLS, FGLS-AR(1) and Bayesian linear regression of a symbol on other symbols and built-in transforms, with robust (HC, HAC, clustered) errors, specification diagnostics, rolling coefficients and influence.","params":[{"name":"symbol","label":"Dependent symbol","required":true,"group":"Model","type":"symbol"},{"name":"regressors","label":"Regressor symbols","group":"Model","help":"Entered with the same transform as the dependent variable, at the same date.","type":"symbols","min":0,"max":12,"default":["SPY"]},{"name":"dependent","label":"Variables in","group":"Model","help":"Prices in levels or logs are usually non-stationary: such a regression is only meaningful if the series are cointegrated.","type":"choice","choices":["returns","log_price","level"],"default":"returns"},{"name":"return_type","label":"Return type","group":"Model","type":"choice","choices":["log","simple"],"default":"log"},{"name":"frequency","label":"Frequency","group":"Data","type":"choice","choices":["daily","weekly","monthly"],"default":"daily"},{"name":"data_period","label":"History (trading days)","group":"Data","help":"Length of the sample in trading days, ending at the end date. Ignored when a start date is given.","type":"int","min":60,"max":7560,"default":756},{"name":"start","label":"Start date (optional)","group":"Data","type":"date"},{"name":"end","label":"End date (optional)","group":"Data","help":"Defaults to the latest session.","type":"date"},{"name":"intercept","label":"Intercept","group":"Model","type":"bool","default":true},{"name":"lags_dependent","label":"Lags of the dependent variable","group":"Transforms","type":"int","min":0,"max":10,"default":0},{"name":"lags_regressors","label":"Lags of each regressor","group":"Transforms","type":"int","min":0,"max":5,"default":0},{"name":"squared_regressors","label":"Squared regressor returns","group":"Transforms","help":"Adds X² for each regressor (convexity, Treynor-Mazuy timing). Returns only.","type":"bool","default":false},{"name":"rolling_vol","label":"Lagged rolling volatility of the dependent","group":"Transforms","type":"bool","default":false},{"name":"vol_window","label":"Volatility window (periods)","group":"Transforms","type":"int","min":5,"max":252,"default":21},{"name":"volume_change","label":"Lagged volume change of the dependent","group":"Transforms","type":"bool","default":false},{"name":"dow_dummies","label":"Day-of-week dummies","group":"Transforms","type":"bool","default":false},{"name":"month_dummies","label":"Month dummies","group":"Transforms","type":"bool","default":false},{"name":"estimator","label":"Estimator","group":"Estimation","help":"glsar = feasible GLS with AR(1) errors (iterated Cochrane-Orcutt); bayes = conjugate normal-inverse-gamma.","type":"choice","choices":["ols","wls","glsar","bayes"],"default":"ols"},{"name":"covariance","label":"Standard errors","group":"Estimation","type":"choice","choices":["classical","HC0","HC1","HC2","HC3","HAC","cluster_month"],"default":"HAC"},{"name":"hac_lags","label":"HAC lags (0 = automatic)","group":"Estimation","type":"int","min":0,"max":250,"default":0},{"name":"wls_weights","label":"WLS weights","group":"Estimation","type":"choice","choices":["inverse_rolling_variance","fgls_log_variance","time_decay"],"default":"inverse_rolling_variance"},{"name":"wls_halflife","label":"Time-decay half-life (periods)","group":"Estimation","type":"int","min":5,"max":2520,"default":126},{"name":"prior_mean","label":"Bayes: prior mean of the slopes","group":"Bayesian prior","visibleWhen":{"estimator":"bayes"},"type":"number","min":-100,"max":100,"default":0},{"name":"prior_scale","label":"Bayes: prior variance scale κ","group":"Bayesian prior","help":"β | σ² ~ N(m₀, σ² κ I). Large κ = diffuse prior (≈ OLS); small κ shrinks towards the prior mean.","visibleWhen":{"estimator":"bayes"},"type":"number","min":0.000001,"max":1000000000000,"default":1000000},{"name":"prior_a","label":"Bayes: inverse-gamma shape a₀","group":"Bayesian prior","visibleWhen":{"estimator":"bayes"},"type":"number","min":0,"max":1000000,"default":0},{"name":"prior_b","label":"Bayes: inverse-gamma scale b₀","group":"Bayesian prior","visibleWhen":{"estimator":"bayes"},"type":"number","min":0,"max":1000000,"default":0},{"name":"confidence","label":"Confidence level","group":"Estimation","type":"number","min":0.5,"max":0.999,"default":0.95},{"name":"rolling_window","label":"Rolling window (periods, 0 = off)","group":"Rolling","type":"int","min":0,"max":2520,"default":126},{"name":"partial_regressor","label":"Partial-regression plot for","group":"Rolling","help":"Name of a term of the coefficient table (default: the first regressor).","type":"text","maxLength":2000}],"category":"econometrics","version":"1.0.0","resultSchema":"lab/1"},{"id":"factor_model","title":"Factor model","summary":"CAPM, Fama-French 3/5-factor and Carhart regressions for one or several assets: annualised alpha, betas with HAC errors, appraisal ratio, rolling betas, return attribution by factor and the GRS joint test of the alphas.","params":[{"name":"symbols","label":"Assets","required":true,"group":"Model","type":"symbols","min":1,"max":30},{"name":"model","label":"Model","group":"Model","help":"capm: market; ff3: + size, value; carhart: ff3 + momentum; ff5: ff3 + profitability, investment; ff6: ff5 + momentum.","type":"choice","choices":["capm","ff3","carhart","ff5","ff6"],"default":"ff3"},{"name":"factors","label":"Factor data","group":"Model","help":"auto: Kenneth French library, ETF proxies if it cannot be reached. custom: your own factor symbols (the model choice is then ignored).","type":"choice","choices":["auto","french","proxies","custom"],"default":"auto"},{"name":"custom_factors","label":"Custom factor symbols","group":"Model","type":"symbols","min":0,"max":8},{"name":"custom_excess","label":"Custom factors in excess of the risk-free rate","group":"Model","type":"bool","default":true},{"name":"risk_free_symbol","label":"Risk-free proxy (proxies / custom)","group":"Model","type":"symbol","default":"BIL"},{"name":"frequency","label":"Frequency","group":"Data","type":"choice","choices":["daily","weekly","monthly"],"default":"daily"},{"name":"data_period","label":"History (trading days)","group":"Data","help":"Length of the sample in trading days, ending at the end date. Ignored when a start date is given.","type":"int","min":60,"max":7560,"default":1260},{"name":"start","label":"Start date (optional)","group":"Data","type":"date"},{"name":"end","label":"End date (optional)","group":"Data","help":"Defaults to the latest session.","type":"date"},{"name":"hac_lags","label":"HAC lags (0 = automatic)","group":"Estimation","type":"int","min":0,"max":250,"default":0},{"name":"confidence","label":"Confidence level","group":"Estimation","type":"number","min":0.5,"max":0.999,"default":0.95},{"name":"rolling_window","label":"Rolling window (periods, 0 = off)","group":"Rolling","type":"int","min":0,"max":2520,"default":126}],"category":"econometrics","version":"1.0.0","resultSchema":"lab/1"},{"id":"panel","title":"Panel regression","summary":"Panel of symbols × dates built from prices and volumes: pooled OLS, fixed effects (entity, time, two-way), random effects and Fama-MacBeth, with clustered and Driscoll-Kraay errors, poolability and Hausman tests.","params":[{"name":"symbols","label":"Symbols (entities)","required":true,"group":"Data","type":"symbols","min":3,"max":60},{"name":"frequency","label":"Frequency","group":"Data","type":"choice","choices":["daily","weekly","monthly"],"default":"weekly"},{"name":"data_period","label":"History (trading days)","group":"Data","help":"Length of the sample in trading days, ending at the end date. Ignored when a start date is given.","type":"int","min":60,"max":7560,"default":1260},{"name":"start","label":"Start date (optional)","group":"Data","type":"date"},{"name":"end","label":"End date (optional)","group":"Data","help":"Defaults to the latest session.","type":"date"},{"name":"return_type","label":"Return type","group":"Data","type":"choice","choices":["log","simple"],"default":"log"},{"name":"dependent","label":"Dependent variable","group":"Model","help":"return: period return; abs_return: |return| (a volatility proxy); volume_change: log change in volume.","type":"choice","choices":["return","abs_return","volume_change"],"default":"return"},{"name":"x_lagged_return","label":"Lagged return (short-term reversal)","group":"Regressors","type":"bool","default":true},{"name":"x_momentum","label":"Momentum over k periods (skipping the latest)","group":"Regressors","type":"bool","default":true},{"name":"momentum_window","label":"Momentum window k (periods)","group":"Regressors","type":"int","min":2,"max":252,"default":12},{"name":"x_volatility","label":"Lagged realized volatility","group":"Regressors","type":"bool","default":true},{"name":"vol_window","label":"Volatility / illiquidity window (periods)","group":"Regressors","type":"int","min":4,"max":252,"default":12},{"name":"x_volume_change","label":"Lagged volume change","group":"Regressors","type":"bool","default":false},{"name":"x_illiquidity","label":"Lagged Amihud illiquidity (log)","group":"Regressors","type":"bool","default":false},{"name":"x_market_return","label":"Market return of the same period","group":"Regressors","help":"Common to all entities: absorbed by time effects and unusable in Fama-MacBeth.","type":"bool","default":false},{"name":"market","label":"Market symbol","group":"Regressors","type":"symbol","default":"SPY"},{"name":"estimator","label":"Estimator","group":"Estimation","type":"choice","choices":["pooled","fe_entity","fe_time","fe_twoway","random_effects","fama_macbeth"],"default":"fe_entity"},{"name":"covariance","label":"Standard errors","group":"Estimation","help":"Returns are strongly correlated across assets on the same date: cluster by time (or two-way, or Driscoll-Kraay).","type":"choice","choices":["unadjusted","robust","cluster_entity","cluster_time","cluster_twoway","driscoll_kraay"],"default":"cluster_time"},{"name":"confidence","label":"Confidence level","group":"Estimation","type":"number","min":0.5,"max":0.999,"default":0.95}],"category":"econometrics","version":"1.0.0","resultSchema":"lab/1"},{"id":"time_series","title":"Time Series (ARIMA / SARIMA)","summary":"ARIMA and seasonal ARIMA with automatic order selection, ADF and KPSS tests, residual diagnostics, fan-chart forecasts and out-of-sample accuracy against a random walk.","params":[{"name":"symbol","label":"Symbol","required":true,"group":"Data","type":"symbol"},{"name":"period_days","label":"History (trading days)","group":"Data","help":"Number of most recent sessions to use when no start date is given (1260 ≈ 5 years).","type":"int","min":60,"max":10000,"default":1260},{"name":"start","label":"Start date","group":"Data","help":"Optional. Overrides the history length.","type":"date"},{"name":"end","label":"End date","group":"Data","help":"Optional. Defaults to the latest available session.","type":"date"},{"name":"series","label":"Series","group":"Series","help":"close = adjusted close; return = log return; volume = traded volume; range = ln(high/low), a volatility proxy.","type":"choice","choices":["close","return","volume","range"],"default":"close"},{"name":"transform","label":"Transformation","group":"Series","help":"Applied before modelling. auto = log for close and volume, level for return and range.","type":"choice","choices":["auto","level","log","diff","log_diff"],"default":"auto"},{"name":"frequency","label":"Frequency","group":"Series","type":"choice","choices":["daily","weekly","monthly"],"default":"daily"},{"name":"auto","label":"Select orders automatically","group":"Model","type":"bool","default":true},{"name":"criterion","label":"Selection criterion","group":"Model","type":"choice","choices":["aic","bic"],"default":"bic"},{"name":"max_p","label":"Largest AR order searched","group":"Model","type":"int","min":0,"max":5,"default":3},{"name":"max_q","label":"Largest MA order searched","group":"Model","type":"int","min":0,"max":5,"default":3},{"name":"p","label":"AR order p (manual)","group":"Model","type":"int","min":0,"max":10,"default":1},{"name":"d","label":"Differencing d","group":"Model","help":"auto = number of differences after which KPSS no longer rejects stationarity.","type":"choice","choices":["auto","0","1","2"],"default":"auto"},{"name":"q","label":"MA order q (manual)","group":"Model","type":"int","min":0,"max":10,"default":0},{"name":"seasonal_period","label":"Seasonal period s","group":"Seasonality","help":"0 = no seasonal part. 5 for a weekly pattern in daily data, 12 for monthly data.","type":"int","min":0,"max":52,"default":0},{"name":"seasonal_p","label":"Seasonal AR order P (manual)","group":"Seasonality","type":"int","min":0,"max":2,"default":1},{"name":"seasonal_d","label":"Seasonal differencing D","group":"Seasonality","type":"int","min":0,"max":1,"default":0},{"name":"seasonal_q","label":"Seasonal MA order Q (manual)","group":"Seasonality","type":"int","min":0,"max":2,"default":0},{"name":"deterministic","label":"Deterministic terms in the unit-root tests","group":"Tests","type":"choice","choices":["constant","constant_trend"],"default":"constant"},{"name":"horizon","label":"Forecast horizon (periods)","group":"Forecast","type":"int","min":1,"max":250,"default":21},{"name":"holdout","label":"Hold-out for accuracy (periods)","group":"Forecast","help":"0 disables the out-of-sample evaluation.","type":"int","min":0,"max":1000,"default":60}],"category":"econometrics","version":"1.0.0","resultSchema":"lab/1"},{"id":"var_model","title":"VAR / VECM and cointegration","summary":"Vector autoregression with lag selection, stability, Granger causality, impulse responses and variance decomposition; Engle-Granger and Johansen cointegration tests and a VECM when the series are cointegrated.","params":[{"name":"symbols","label":"Symbols","required":true,"group":"Data","help":"The order matters for impulse responses: a shock to a symbol can move the symbols listed after it within the day, not those before.","type":"symbols","min":2,"max":8},{"name":"period_days","label":"History (trading days)","group":"Data","help":"Number of most recent sessions to use when no start date is given (1260 ≈ 5 years).","type":"int","min":60,"max":10000,"default":1260},{"name":"start","label":"Start date","group":"Data","help":"Optional. Overrides the history length.","type":"date"},{"name":"end","label":"End date","group":"Data","help":"Optional. Defaults to the latest available session.","type":"date"},{"name":"var_on","label":"VAR estimated on","group":"VAR","help":"returns = first differences of log prices (stationary); log_prices = levels (only meaningful if the series are stationary or cointegrated).","type":"choice","choices":["returns","log_prices"],"default":"returns"},{"name":"lags","label":"VAR lags (0 = automatic)","group":"VAR","type":"int","min":0,"max":20,"default":0},{"name":"max_lags","label":"Largest lag searched","group":"VAR","type":"int","min":1,"max":20,"default":10},{"name":"criterion","label":"Lag selection criterion","group":"VAR","type":"choice","choices":["aic","bic","hqic"],"default":"bic"},{"name":"irf_horizon","label":"Impulse-response horizon (days)","group":"Impulse responses","type":"int","min":1,"max":60,"default":10},{"name":"cumulative","label":"Cumulative responses","group":"Impulse responses","help":"With a VAR on returns, cumulative responses are the effects on log prices.","type":"bool","default":false},{"name":"band_level","label":"Confidence level of the bands","group":"Impulse responses","type":"number","min":0.5,"max":0.99,"default":0.95},{"name":"deterministic","label":"Deterministic terms (cointegration)","group":"Cointegration","type":"choice","choices":["none","constant","trend"],"default":"constant"},{"name":"coint_lags","label":"Lagged differences in Johansen / VECM (−1 = automatic)","group":"Cointegration","type":"int","min":-1,"max":20,"default":-1},{"name":"rank_test","label":"Rank chosen by","group":"Cointegration","type":"choice","choices":["trace","max_eigenvalue"],"default":"trace"}],"category":"econometrics","version":"1.0.0","resultSchema":"lab/1"},{"id":"event_study","title":"Event study","summary":"Abnormal returns around events (explicit dates or earnings announcements): market model, CAR and BHAR per event, average CAAR with cross-sectional, Patell, BMP, sign and rank tests, overlap and thin-trading checks.","params":[{"name":"symbols","label":"Symbols","group":"Events","help":"Needed for earnings announcements, or when the events are given as bare dates (one symbol).","type":"symbols","min":0,"max":30},{"name":"events","label":"Events","group":"Events","help":"Leave empty to use the earnings announcement dates of the symbols.","type":"json","maxBytes":65536,"schemaHint":"[{\"symbol\": \"AAPL\", \"date\": \"2025-05-01\"}, …]  or  [\"2025-05-01\", \"2025-07-31\"] with one symbol"},{"name":"event_source","label":"Event source","group":"Events","help":"auto: the explicit list when given, otherwise earnings announcements (FMP).","type":"choice","choices":["auto","explicit","earnings"],"default":"auto"},{"name":"max_events_per_symbol","label":"Earnings: most recent announcements per symbol","group":"Events","type":"int","min":1,"max":60,"default":12},{"name":"market","label":"Market index / ETF","group":"Model","type":"symbol","default":"SPY"},{"name":"model","label":"Normal-return model","group":"Model","type":"choice","choices":["market_model","market_adjusted","mean_adjusted"],"default":"market_model"},{"name":"return_type","label":"Return type","group":"Model","type":"choice","choices":["simple","log"],"default":"simple"},{"name":"estimation_window","label":"Estimation window (sessions)","group":"Windows","type":"int","min":30,"max":500,"default":120},{"name":"gap","label":"Gap before the event window (sessions)","group":"Windows","type":"int","min":0,"max":60,"default":10},{"name":"pre","label":"Event window: sessions before","group":"Windows","type":"int","min":0,"max":60,"default":5},{"name":"post","label":"Event window: sessions after","group":"Windows","type":"int","min":0,"max":120,"default":5},{"name":"drop_overlapping","label":"Drop events whose window overlaps an earlier event of the same symbol","group":"Windows","type":"bool","default":false},{"name":"confidence","label":"Confidence level","group":"Model","type":"number","min":0.5,"max":0.999,"default":0.95}],"category":"econometrics","version":"1.0.0","resultSchema":"lab/1"},{"id":"pca","title":"Principal components","summary":"PCA of the returns of a list of symbols: eigenvalues, explained variance, loadings, component series, Marchenko-Pastur noise bound, reconstruction error, rolling first-component share and absorption ratio.","params":[{"name":"symbols","label":"Symbols","required":true,"group":"Data","type":"symbols","min":3,"max":80},{"name":"basis","label":"Decompose the","group":"Model","help":"Correlation gives every asset the same weight; covariance lets the most volatile assets dominate.","type":"choice","choices":["correlation","covariance"],"default":"correlation"},{"name":"return_type","label":"Return type","group":"Data","type":"choice","choices":["log","simple"],"default":"log"},{"name":"frequency","label":"Frequency","group":"Data","type":"choice","choices":["daily","weekly","monthly"],"default":"daily"},{"name":"data_period","label":"History (trading days)","group":"Data","help":"Length of the sample in trading days, ending at the end date. Ignored when a start date is given.","type":"int","min":60,"max":7560,"default":756},{"name":"start","label":"Start date (optional)","group":"Data","type":"date"},{"name":"end","label":"End date (optional)","group":"Data","help":"Defaults to the latest session.","type":"date"},{"name":"n_components","label":"Components to detail","group":"Model","type":"int","min":1,"max":20,"default":5},{"name":"rolling_window","label":"Rolling window (periods, 0 = off)","group":"Rolling","type":"int","min":0,"max":2520,"default":126},{"name":"absorption_fraction","label":"Absorption ratio: share of components","group":"Rolling","help":"Kritzman, Li, Page and Rigobon use one fifth of the number of assets.","type":"number","min":0.01,"max":1,"default":0.2}],"category":"econometrics","version":"1.0.0","resultSchema":"lab/1"},{"id":"bootstrap","title":"Bootstrap confidence intervals","summary":"Bootstrap confidence intervals (i.i.d., moving-block, circular-block, stationary) for mean, volatility, Sharpe, Sortino, maximum drawdown, skewness, correlation, beta and the difference of two Sharpe ratios.","params":[{"name":"symbol","label":"Symbol","required":true,"group":"Data","type":"symbol"},{"name":"benchmark","label":"Second symbol (benchmark)","group":"Data","help":"Needed for correlation, beta and the difference of Sharpe ratios.","requiredWhen":{"statistic":["correlation","beta","sharpe_difference"]},"type":"symbol"},{"name":"period_days","label":"History (trading days)","group":"Data","help":"Number of most recent sessions to use when no start date is given (1260 ≈ 5 years).","type":"int","min":60,"max":10000,"default":1260},{"name":"start","label":"Start date","group":"Data","help":"Optional. Overrides the history length.","type":"date"},{"name":"end","label":"End date","group":"Data","help":"Optional. Defaults to the latest available session.","type":"date"},{"name":"statistic","label":"Statistic","group":"Statistic","help":"all = every statistic available for the data given (pair statistics need the second symbol).","type":"choice","choices":["all","mean","volatility","sharpe","sortino","max_drawdown","skewness","correlation","beta","sharpe_difference"],"default":"all"},{"name":"risk_free","label":"Risk-free rate (annual)","group":"Statistic","help":"As a fraction: 0.04 = 4 %. Used by Sharpe and Sortino.","type":"number","min":-0.05,"max":0.25,"default":0},{"name":"method","label":"Resampling","group":"Bootstrap","help":"stationary = Politis-Romano, random block lengths; circular / moving = fixed blocks; iid = independent draws (ignores serial dependence).","type":"choice","choices":["stationary","circular","moving","iid"],"default":"stationary"},{"name":"block_length","label":"Block length (0 = automatic)","group":"Bootstrap","type":"number","min":0,"max":500,"default":0},{"name":"replications","label":"Replications","group":"Bootstrap","type":"int","min":200,"max":20000,"default":2000},{"name":"confidence","label":"Confidence level","group":"Bootstrap","type":"number","min":0.5,"max":0.999,"default":0.95},{"name":"seed","label":"Random seed","group":"Bootstrap","type":"int","min":0,"max":2147483647,"default":12345}],"category":"simulation","version":"1.0.0","resultSchema":"lab/1"},{"id":"options_lab","title":"Options Lab","summary":"Black-Scholes-Merton, CRR binomial and Monte Carlo pricing, Greeks, implied volatility, multi-leg strategies, and chain analytics on real quotes (smile, term structure, surface, skew, max pain, dealer exposure estimates).","params":[{"name":"symbol","label":"Underlying","required":true,"type":"symbol","default":"SPY"},{"name":"mode","label":"Analysis","help":"price: models and Greeks · implied: volatility from a market price · strategy: multi-leg payoff · chain: analytics on the listed chain","type":"choice","choices":["price","implied","strategy","chain"],"default":"price"},{"name":"option_type","label":"Option type","group":"Contract","type":"choice","choices":["call","put"],"default":"call"},{"name":"style","label":"Exercise style","group":"Contract","type":"choice","choices":["european","american"],"default":"european"},{"name":"strike","label":"Strike","group":"Contract","help":"Default: the spot rounded to the nearest strike step (at the money).","type":"number","min":0.0001,"max":1000000000000000},{"name":"expiry_days","label":"Calendar days to expiry","group":"Contract","type":"int","min":1,"max":3650,"default":30},{"name":"multiplier","label":"Contract multiplier","group":"Contract","type":"int","min":1,"max":10000,"default":100},{"name":"spot","label":"Spot price","group":"Market","help":"Default: the latest observed close.","type":"number","min":0.0001,"max":1000000000000000},{"name":"volatility","label":"Volatility (annual, fraction)","group":"Market","help":"0.20 = 20 %. Default: historical close-to-close volatility over the window below (stated in the result).","type":"number","min":0.0001,"max":5},{"name":"vol_window","label":"Historical volatility window (sessions)","group":"Market","type":"int","min":10,"max":1260,"default":63},{"name":"rate","label":"Risk-free rate (continuous, fraction)","group":"Market","type":"number","min":-0.05,"max":0.5,"default":0.04},{"name":"dividend_yield","label":"Dividend yield (continuous, fraction)","group":"Market","type":"number","min":0,"max":0.5,"default":0},{"name":"dividends","label":"Discrete dividends","group":"Market","help":"Cash dividends before expiry (calendar days from today, amount per share). Escrowed-dividend model.","type":"json","maxBytes":65536,"schemaHint":"[{\"days\": 20, \"amount\": 1.25}]"},{"name":"market_price","label":"Market price of the option","group":"Implied volatility","help":"Required in mode implied.","requiredWhen":{"mode":"implied"},"visibleWhen":{"mode":"implied"},"type":"number","min":0,"max":1000000000000000},{"name":"steps","label":"Binomial steps","group":"Numerics","type":"int","min":10,"max":2000,"default":500},{"name":"simulations","label":"Monte Carlo paths","group":"Numerics","type":"int","min":1000,"max":2000000,"default":100000},{"name":"seed","label":"Random seed","group":"Numerics","type":"int","min":0,"max":1000000000000000,"default":12345},{"name":"template","label":"Strategy template","group":"Strategy","help":"Built around the spot. \"custom\" uses the legs below.","visibleWhen":{"mode":"strategy"},"type":"choice","choices":["custom","long_call","long_put","covered_call","protective_put","bull_call_spread","bear_put_spread","bull_put_spread","bear_call_spread","straddle","strangle","butterfly","iron_condor","calendar"],"default":"straddle"},{"name":"legs","label":"Legs","group":"Strategy","help":"When given, replaces the template. Option quantities are contracts (× multiplier), stock quantities are shares. premium is per share; omitted = model value.","requiredWhen":{"mode":"strategy","template":"custom"},"visibleWhen":{"mode":"strategy"},"type":"json","maxBytes":65536,"schemaHint":"[{\"type\": \"call|put|stock\", \"side\": \"long|short\", \"strike\": 100, \"expiry_days\": 30, \"quantity\": 1, \"premium\": 2.5}]"},{"name":"width","label":"Template wing width (fraction of spot)","group":"Strategy","visibleWhen":{"mode":"strategy"},"type":"number","min":0.005,"max":0.5,"default":0.05},{"name":"far_expiry_days","label":"Calendar: far expiry (days)","group":"Strategy","visibleWhen":{"mode":"strategy"},"type":"int","min":2,"max":3650,"default":60},{"name":"drift","label":"Drift for probabilities (annual, fraction)","group":"Strategy","help":"Default: risk-neutral (rate − dividend yield). A real-world drift is your assumption.","visibleWhen":{"mode":"strategy"},"type":"number","min":-1,"max":1},{"name":"provider","label":"Chain provider","group":"Chain","visibleWhen":{"mode":"chain"},"type":"choice","choices":["auto","eodhd","findata"],"default":"auto"},{"name":"trade_date","label":"Chain trade date","group":"Chain","help":"Historical end-of-day chain (FinData only). Default: latest available.","visibleWhen":{"mode":"chain"},"type":"date"},{"name":"max_dte","label":"Longest maturity (days)","group":"Chain","visibleWhen":{"mode":"chain"},"type":"int","min":7,"max":1100,"default":180},{"name":"min_dte","label":"Shortest maturity (days)","group":"Chain","visibleWhen":{"mode":"chain"},"type":"int","min":1,"max":365,"default":2},{"name":"strike_window","label":"Strike window (± fraction of spot)","group":"Chain","visibleWhen":{"mode":"chain"},"type":"number","min":0.05,"max":0.9,"default":0.3},{"name":"min_open_interest","label":"Minimum open interest","group":"Chain","visibleWhen":{"mode":"chain"},"type":"int","min":0,"max":100000,"default":10},{"name":"max_rel_spread","label":"Maximum bid-ask spread (fraction of mid)","group":"Chain","visibleWhen":{"mode":"chain"},"type":"number","min":0.01,"max":2,"default":0.5}],"category":"options","version":"1.0.0","resultSchema":"lab/1"},{"id":"backtest","title":"Strategy Backtest","summary":"Vectorized research backtests on daily bars with signals traded one bar later by construction, costs, slippage, benchmark, walk-forward validation, parameter sensitivity and overfitting-aware statistics (probabilistic and deflated Sharpe ratios).","params":[{"name":"symbols","label":"Symbols","required":true,"help":"One symbol, or a universe for rotation and portfolio strategies (max 30).","type":"symbols","min":1,"max":50,"default":["SPY"]},{"name":"strategy","label":"Strategy","type":"choice","choices":["buy_hold","ma_cross","ts_momentum","xs_momentum","mean_reversion","donchian","fixed_weight","risk_parity","rule"],"default":"ma_cross"},{"name":"strategy_params","label":"Strategy parameters","help":"Omitted keys take the documented defaults.","type":"json","maxBytes":65536,"schemaHint":"buy_hold {} · ma_cross {\"fast\": 50, \"slow\": 200} · ts_momentum {\"lookback_months\": 12, \"skip_days\": 0} · xs_momentum {\"lookback_months\": 6, \"skip_days\": 21, \"top_n\": 3} · mean_reversion {\"method\": \"zscore|rsi\", \"window\": 20, \"entry\": 2.0, \"exit\": 0.0, \"rsi_low\": 30, \"rsi_exit\": 50} · donchian {\"entry_window\": 20, \"exit_window\": 10} · fixed_weight {\"weights\": {\"SPY\": 0.6, \"TLT\": 0.4}} · risk_parity {\"cov_window\": 126} · rule {\"exit\": \"close < sma(close, 50)\"}"},{"name":"rule","label":"Custom entry rule","group":"Custom rule","help":"For strategy \"rule\": long while the expression is true, e.g. sma(close, 20) > sma(close, 100) and rsi(close, 14) < 70. Series: open, high, low, close, volume. Functions: sma, ema, std, zscore, rsi, roc, highest, lowest, lag, abs, max, min. Windows are whole numbers of bars.","requiredWhen":{"strategy":"rule"},"visibleWhen":{"strategy":"rule"},"type":"text","maxLength":2000},{"name":"years","label":"History (years)","group":"Period","help":"Used when no start date is given.","type":"int","min":1,"max":40,"default":10},{"name":"start","label":"Start date","group":"Period","type":"date"},{"name":"end","label":"End date","group":"Period","type":"date"},{"name":"execution","label":"Execution of the bar-t signal","group":"Mechanics","type":"choice","choices":["next_open","next_close"],"default":"next_open"},{"name":"rebalance","label":"Rebalancing schedule","group":"Mechanics","help":"auto: daily for signal strategies, monthly for rotation and portfolio strategies.","type":"choice","choices":["auto","daily","weekly","monthly"],"default":"auto"},{"name":"position_size","label":"Position size (fraction of equity)","group":"Mechanics","type":"number","min":0.01,"max":5,"default":1},{"name":"allow_short","label":"Allow short positions","group":"Mechanics","type":"bool","default":false},{"name":"max_leverage","label":"Maximum gross exposure","group":"Mechanics","type":"number","min":0.1,"max":5,"default":1},{"name":"vol_target","label":"Volatility target (annual, fraction)","group":"Mechanics","help":"Optional overlay: scales the position so that its recent realized volatility matches the target, within the maximum gross exposure.","type":"number","min":0.01,"max":1},{"name":"vol_window","label":"Volatility-target window (sessions)","group":"Mechanics","type":"int","min":5,"max":252,"default":20},{"name":"cost_bps","label":"Transaction cost (bps of traded value)","group":"Costs","type":"number","min":0,"max":500,"default":5},{"name":"slippage_bps","label":"Slippage (bps of traded value)","group":"Costs","type":"number","min":0,"max":500,"default":2},{"name":"slippage_model","label":"Slippage model","group":"Costs","help":"roll_half_spread: half the Roll (1984) effective spread estimated per asset from daily closes; falls back to the fixed bps when not estimable.","type":"choice","choices":["fixed","roll_half_spread"],"default":"fixed"},{"name":"financing_rate","label":"Financing rate for leverage and shorts (annual, fraction)","group":"Costs","type":"number","min":0,"max":0.5,"default":0},{"name":"benchmark","label":"Benchmark","group":"Evaluation","help":"Default: buy & hold of the symbol, or the equal-weight universe rebalanced daily.","type":"symbol"},{"name":"risk_free","label":"Risk-free rate (annual, fraction)","group":"Evaluation","type":"number","min":-0.05,"max":0.5,"default":0},{"name":"n_trials","label":"Configurations tried in total","group":"Evaluation","help":"For the deflated Sharpe ratio: every variant you tried, including outside this run. Default: the configurations evaluated in this run.","type":"int","min":1,"max":100000},{"name":"walk_forward","label":"Walk-forward validation","group":"Validation","type":"bool","default":false},{"name":"train_days","label":"Walk-forward training window (sessions)","group":"Validation","visibleWhen":{"walk_forward":true},"type":"int","min":126,"max":5040,"default":756},{"name":"test_days","label":"Walk-forward test window (sessions)","group":"Validation","visibleWhen":{"walk_forward":true},"type":"int","min":21,"max":1260,"default":126},{"name":"sensitivity","label":"Parameter sensitivity grid","group":"Validation","type":"bool","default":false},{"name":"grid","label":"Parameter grid","group":"Validation","help":"For walk-forward and sensitivity. Default: a small built-in grid per strategy. At most 40 combinations.","type":"json","maxBytes":65536,"schemaHint":"{\"fast\": [20, 50, 100], \"slow\": [150, 200, 250]}"}],"category":"backtest","version":"1.0.0","resultSchema":"lab/1"},{"id":"portfolio_lab","title":"Portfolio Lab","summary":"Multi-currency valuation, allocation, risk contributions, attribution, factor exposures on ETF proxies, efficient frontier and optimizers (max Sharpe, min variance, risk parity, HRP, max diversification), a rebalancing proposal, shock scenarios and a Monte Carlo fan.","params":[{"name":"positions","label":"Positions","help":"Quantities held; costBasis is per unit in the asset's quote currency (optional); currency overrides the looked-up quote currency (optional). Replaces symbols/weights.","type":"json","maxBytes":65536,"schemaHint":"[{\"symbol\": \"AAPL\", \"quantity\": 25, \"costBasis\": 150.0, \"currency\": \"USD\"}]"},{"name":"symbols","label":"Symbols","help":"Used with weights when no positions are given (max 30).","type":"symbols","min":1,"max":50,"default":["SPY","TLT","GLD"]},{"name":"weights","label":"Weights","help":"One per symbol, as fractions of the portfolio value. Default: equal weights.","type":"numbers","min":-1000000000000000,"max":1000000000000000,"maxItems":100},{"name":"cash","label":"Cash by currency","type":"json","maxBytes":65536,"schemaHint":"{\"USD\": 2500, \"CAD\": 1000}"},{"name":"base_currency","label":"Base currency","type":"text","maxLength":2000,"default":"USD"},{"name":"portfolio_value","label":"Portfolio value (weights mode)","group":"Valuation","help":"Only with symbols + weights: the value used to size trades, in the base currency.","type":"number","min":1,"max":1000000000000000,"default":100000},{"name":"benchmark","label":"Benchmark","group":"Risk","type":"symbol","default":"SPY"},{"name":"lookback_days","label":"History (sessions)","group":"Risk","type":"int","min":120,"max":5040,"default":756},{"name":"confidence","label":"VaR confidence","group":"Risk","type":"number","min":0.8,"max":0.999,"default":0.95},{"name":"covariance","label":"Covariance estimator","group":"Risk","type":"choice","choices":["ledoit_wolf","sample"],"default":"ledoit_wolf"},{"name":"factors","label":"Factor exposures and factor scenarios","group":"Risk","type":"bool","default":true},{"name":"objective","label":"Target for the rebalancing proposal","group":"Optimisation","help":"\"none\" skips the proposal; \"target\" uses your target weights.","type":"choice","choices":["max_sharpe","min_variance","risk_parity","hrp","max_diversification","equal_weight","target","none"],"default":"min_variance"},{"name":"target_weights","label":"Target weights","group":"Optimisation","requiredWhen":{"objective":"target"},"visibleWhen":{"objective":"target"},"type":"json","maxBytes":65536,"schemaHint":"{\"AAPL\": 0.3, \"MSFT\": 0.3, \"TLT\": 0.4}"},{"name":"expected_returns","label":"Expected returns","group":"Optimisation","type":"choice","choices":["historical","james_stein"],"default":"james_stein"},{"name":"min_weight","label":"Minimum weight per asset","group":"Optimisation","type":"number","min":-1,"max":1,"default":0},{"name":"max_weight","label":"Maximum weight per asset","group":"Optimisation","type":"number","min":0.01,"max":2,"default":1},{"name":"risk_free","label":"Risk-free rate (annual, fraction)","group":"Optimisation","type":"number","min":-0.05,"max":0.5,"default":0.04},{"name":"cost_bps","label":"Trading cost for the proposal (bps)","group":"Optimisation","type":"number","min":0,"max":500,"default":5},{"name":"shocks","label":"Scenario shocks","group":"Scenarios","help":"factor: market, size, value, momentum, rates, credit, usd. shock = return of the factor proxy; for rates, bps is converted with a duration of 17 years.","type":"json","maxBytes":65536,"schemaHint":"[{\"name\": \"Equities -30 %\", \"factor\": \"market\", \"shock\": -0.30}, {\"name\": \"Rates +200 bps\", \"factor\": \"rates\", \"bps\": 200}]"},{"name":"horizon_days","label":"Simulation horizon (sessions)","group":"Scenarios","type":"int","min":5,"max":2520,"default":252},{"name":"simulations","label":"Monte Carlo paths","group":"Scenarios","type":"int","min":500,"max":50000,"default":5000},{"name":"seed","label":"Random seed","group":"Scenarios","type":"int","min":0,"max":1000000000000000,"default":12345}],"category":"portfolio","version":"1.0.0","resultSchema":"lab/1"}],"maxRunning":3,"unavailable":{}}
Files main
Menu

Theme