momentum
Calculate technical indicators like RSI, MACD, and stochastic oscillators directly from price data, then summarize signals and factor performance across tickers.
Instructions
Momentum technical indicators (RSI, MACD, Stochastic Oscillator, Williams %R, Aroon, ADX, CCI, MFI, rate of change, Ichimoku Cloud, awesome, ultimate and Chande momentum oscillators, vortex, Know Sure Thing and more). Applied to price data automatically — no need to fetch prices first. Each indicator needs its window of history before it produces values, so the first periods after start_date can be empty and quarterly or yearly periods with long windows can be empty on short histories; start earlier to warm up. Requires tickers='AAPL' — use comma-separated values for multiple tickers. get_relative_strength gives the price relative to the benchmark, the Mansfield relative strength and a 1-99 relative strength rating across the tickers; get_seasonality the average return, hit rate and t-statistic per calendar month (frequency='month') or weekday (frequency='weekday'); get_signals the events per period: moving average crossovers (golden and death cross with the default 50 and 200), MACD crossovers, the RSI entering and leaving its overbought and oversold zones, Bollinger Band breakouts and new 52-week highs and lows, each 1 for a cross upwards, -1 for a cross downwards and 0 otherwise; signals_only=true returns only the periods with a signal (with limit=-5 the last five). get_indicator_summary summarises an indicator's history in one row per ticker instead of the daily series (use it rather than the full series for questions such as 'how low is the RSI compared with the last five years'): metric= the indicator (get_relative_strength_index by default, or any technical indicator, column= for one with several outputs), the latest value with its percentile and rank in its own history up to that date, the mean, minimum and maximum with their dates; below=30 (or above=70) adds the periods beyond the line, the number and last date of the crossings into that zone, and forward_periods=[5, 21, 63] the average return after those crossings next to the average return over every period; show_crossings=true lists every crossing with its value, percentile at the time and forward returns. Other parameters (e.g. window=) pass to the indicator. get_factor_analysis: factor analysis (predictive power) of the technical indicators across tickers: do the tickers that score high on one go on to return more than those that score low? Needs tickers= with at least ten, preferably twenty or more tickers. metrics= an indicator name, a comma-separated list, or a collection: 'momentum' (default), 'overlap', 'volatility', 'breadth' or 'all'; column= picks the output of a multi-output indicator (e.g. 'Signal Line'). Returns a row per metric and horizon: the mean information coefficient (IC, the Spearman rank correlation between the metric and the later returns), its standard deviation, IC information ratio, t-statistic, p-value, share of positive periods, number of periods, the Top Minus Bottom quantile spread, quantile turnover and rank autocorrelation. detail='information_coefficient', 'quantile_returns', 'quantile_turnover' or 'rank_autocorrelation' returns that part per period (or per quantile) for a single metric. period= sets how often it is evaluated (monthly by default), horizons= the periods ahead (e.g. 12 or [1, 12]), quantiles= the number of quantiles (5). Other parameters (e.g. window=) pass to the indicators; indicators in price units are used relative to the close. The IC is reported as measured: a negative IC means low values go on to outperform.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"indicator": "<indicator>"
},
"name": "momentum"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| lag | No | Number of periods to lag when computing growth rates. | |
| rank | No | true ranks the tickers (or countries) within every period, from the highest value (rank 1) to the lowest, and compares each with its neighbour toward the middle of the ranking: the Difference (in points for returns) and the Multiple (only when both have the same sign), so the first and last rank show how far the best and the worst stand apart, e.g. a fall more than twice as large as the next one. Needs a value per period and ticker; pick one field with show_columns where there are more. | |
| above | No | get_indicator_summary only: the line the indicator rises above, e.g. 70 for an overbought RSI. | |
| below | No | get_indicator_summary only: the line the indicator falls below, e.g. 30 for an oversold RSI; adds the periods below it, the crossings into that zone and the returns after them. | |
| limit | No | The rows to return, like head and tail: 5 for the first five, -5 for the last five (the most recent of a time series). A table with its periods as columns (financial statements, ratios) keeps its first or last periods instead, and rows per ticker (an earnings calendar) are selected per ticker. For ETF holdings the largest (or, negative, the smallest) by weight, and for a list (e.g. news or a screener) its length. 0 returns every row. | |
| column | No | The price column to use, e.g. 'Close' or 'Adj Close'; for get_factor_analysis the output of a metric with several, e.g. 'Signal Line'. | |
| detail | No | get_factor_analysis only: 'information_coefficient', 'quantile_returns', 'quantile_turnover' or 'rank_autocorrelation' returns that part for a single metric instead of the summary. | |
| growth | No | Return period-over-period growth rates instead of absolute values. | |
| metric | No | get_indicator_summary only: the indicator to summarise, e.g. 'get_relative_strength_index' (default) or 'get_stochastic_oscillator'. | get_relative_strength_index |
| period | No | Observation frequency, e.g. 'daily', 'weekly', 'monthly', 'quarterly', or 'annual' (supported values differ per method). Leave unset to use the default of the indicator you selected. Defaults differ between indicators. | |
| window | No | The number of periods the indicator looks back over, e.g. 14 or 20. Leave unset to use the default of the indicator you selected. Defaults differ between indicators. | |
| metrics | No | get_factor_analysis only: the metric(s) to analyse, a method name such as 'get_price_to_earnings_ratio', a comma-separated list, or a collection of the tool (see the tool description), e.g. 'profitability'. | momentum |
| tickers | No | Comma-separated ticker symbols, e.g. 'AAPL,MSFT,GOOGL'. | |
| weights | No | The four weights applied to each smoothed Rate of Change series before summing. | |
| constant | No | Constant multiplier used in the CCI calculation. | |
| end_date | No | End of the date range in YYYY-MM-DD format; left empty, today (or the indicator's own window). | |
| horizons | No | The number of periods the forward returns cover. | |
| window_1 | No | The number of periods for the first short-term window. | |
| window_2 | No | The number of periods for the second mid-term window. | |
| window_3 | No | The number of periods for the third long-term window. | |
| frequency | No | "month" (per calendar month) or "weekday" (per day of the week). | month |
| indicator | Yes | Name of the specific metric to calculate, one of the listed values. Required — search_metrics finds the indicator (and its tool) for a metric by name. | |
| quantiles | No | The number of quantiles the tickers are sorted into per period. | |
| quarterly | No | Return quarterly data instead of annual when True. | |
| rsi_window | No | The window of the RSI. | |
| start_date | No | Start of the date range in YYYY-MM-DD format; left empty, five years before today (or the indicator's own window). | |
| base_window | No | The number of periods to consider for the Base Line (Kijun-sen) calculation, also used as the forward displacement for both Leading Spans. | |
| long_window | No | The window of the long moving average. Leave unset to use the default of the indicator you selected. Defaults are 26 for get_moving_average_convergence_divergence, get_percentage_price_oscillator; 200 for get_signals; 34 for get_awesome_oscillator. | |
| roc_windows | No | The four lookback periods used for the underlying Rate of Change calculations. | |
| sma_windows | No | The four Simple Moving Average smoothing periods applied to each Rate of Change series. | |
| standardize | No | Return the Z-Score (standard score) instead of the raw values, i.e. how many standard deviations each value is from the mean of its own series. When combined with growth=True, the growth values are standardized instead of the raw values. | |
| close_column | No | The column in the historical data that represents. | Adj Close |
| rsi_oversold | No | The RSI below which a price is oversold. | |
| short_window | No | The window of the short moving average. Leave unset to use the default of the indicator you selected. Defaults are 12 for get_moving_average_convergence_divergence, get_percentage_price_oscillator; 5 for get_awesome_oscillator; 50 for get_signals. | |
| show_columns | No | Comma-separated names to filter the output. For historical data use the key names visible in any response record (e.g. 'Close,Volume,Return'). For financial statements use the 'metric' field values from the response (e.g. 'Revenue,Net Income,EBITDA'). Call the tool once without this parameter to see all available names, then repeat with show_columns to reduce response size and token usage. | |
| signals_only | No | get_signals and get_candlestick_patterns only: set to true to return only the periods with a signal or pattern, e.g. with limit=-5 for the last five. | |
| periods_apart | No | The number of periods between the dates the quantile turnover and the rank autocorrelation compare. | |
| signal_window | No | For get_moving_average_convergence_divergence: The number of periods for the signal line. For get_know_sure_thing: Number of periods for the Simple Moving Average of the KST used as the signal line. | |
| smooth_window | No | The number of periods used to smooth the %K line into the %D signal line. | |
| rsi_overbought | No | The RSI above which a price is overbought. | |
| show_crossings | No | get_indicator_summary only: set to true for a row per crossing (date, value, its percentile at the time and the forward returns) instead of the summary. | |
| forward_periods | No | get_indicator_summary only: the trading periods after each crossing to measure the return over, e.g. [5, 21, 63] for about a week, a month and a quarter. | |
| high_low_window | No | The number of previous periods a new high or low is measured against. | |
| benchmark_ticker | No | Ticker used as the market benchmark, e.g. 'SPY' or '^GSPC'; 'None' for no benchmark. | SPY |
| bollinger_window | No | The window of the Bollinger Bands. | |
| macd_long_window | No | The long window of the MACD. | |
| bollinger_std_dev | No | The number of standard deviations of the Bollinger Bands. | |
| conversion_window | No | The number of periods to consider for the Conversion Line (Tenkan-sen) calculation. | |
| macd_short_window | No | The short window of the MACD. | |
| lead_span_b_window | No | The number of periods to consider for the Lead Span B (Senkou Span B) calculation. | |
| macd_signal_window | No | The window of the MACD's signal line. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |