> ## Documentation Index
> Fetch the complete documentation index at: https://docs.quantspace.limex.pro/llms.txt
> Use this file to discover all available pages before exploring further.

# Wavelet Mean Reversion Server

> Wavelet-based mean reversion analysis for financial time series.

## Overview

The Wavelet Mean Reversion Server fetches market data, analyzes returns or signals with wavelet decomposition, and generates synthetic data for experiments.

## Connection

Add this server to your MCP client configuration.

<Tabs>
  <Tab title="Cursor">
    ```json theme={null}
    {
      "mcpServers": {
        "wavelet-mean-reversion": {
          "url": "https://wavelet-mean-reversion-production.up.railway.app/mcp/waveletmeanreversion"
        }
      }
    }
    ```
  </Tab>

  <Tab title="Bearer auth">
    ```json theme={null}
    {
      "mcpServers": {
        "wavelet-mean-reversion": {
          "url": "https://wavelet-mean-reversion-production.up.railway.app/mcp/waveletmeanreversion",
          "headers": {
            "Authorization": "Bearer ${env:WAVELET_MEAN_REVERSION_MCP_TOKEN}"
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

Restart the client after changing MCP configuration. The server tools appear automatically after the connection is established.

## Transport

| Property         | Value                                                                               |
| ---------------- | ----------------------------------------------------------------------------------- |
| Protocol         | MCP over Streamable HTTP                                                            |
| MCP URL          | `https://wavelet-mean-reversion-production.up.railway.app/mcp/waveletmeanreversion` |
| Health URL       | `https://wavelet-mean-reversion-production.up.railway.app/health`                   |
| MCP path         | `/mcp/waveletmeanreversion`                                                         |
| Request envelope | `{"request": {...}}`                                                                |
| Auth             | Optional bearer token when enabled for the endpoint                                 |

## Best-Fit Workflows

* Fetch Yahoo market data.
* Compute returns for a ticker.
* Run wavelet decomposition and mean reversion analysis.
* Generate synthetic mean-reverting or trending data.
* Backtest simple wavelet mean-reversion strategies.

## Recommended Tools

* yahoo-data-fetcher-fetch
* yahoo-data-fetcher-fetch-returns
* wavelet-analyzer-analyze
* wavelet-analysis-result-summary
* wavelet-analysis-result-get-statistics-dataframe

## Tools

| Tool                                               | Description                                                                                                                                                                                                                                                                                                                          | Returns                 |
| -------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------- |
| `main`                                             | Main example demonstrating wavelet mean reversion analysis and trading strategy.                                                                                                                                                                                                                                                     | `Any`                   |
| `yahoo-data-fetcher-fetch`                         | Fetches historical stock data from Yahoo Finance for one or more tickers. Params: ticker (str or list): stock symbol(s); start\_date (str, optional): start date; end\_date (str, optional): end date; period (str, default='max'): time period; interval (str, default='1d'): data frequency                                        | `Any`                   |
| `wavelet-mean-reversion-strategy-generate-signals` | Generate trading signals.                                                                                                                                                                                                                                                                                                            | `Any`                   |
| `wavelet-analyzer-decompose`                       | Decomposes a signal into wavelet components for mean reversion analysis. Params: signal: np.ndarray (input signal to decompose)                                                                                                                                                                                                      | `Any`                   |
| `wavelet-analyzer-analyze`                         | Analyzes a signal using wavelet decomposition to detect mean reversion patterns. Outputs analysis results for further processing in trading strategies. Params: signal: np.ndarray - input signal data to analyze (no default provided)                                                                                              | `Any`                   |
| `yahoo-data-fetcher-fetch-returns`                 | Fetches historical stock returns from Yahoo Finance for a given ticker symbol, supporting optional date ranges, return period, and log return calculation. Params: ticker (str), start\_date (str, optional), end\_date (str, optional), period (str, default='max'), log\_returns (bool, default=True)                              | `Any`                   |
| `yahoo-data-fetcher-fetch-multiple-series`         | Fetches historical stock price data for multiple tickers from Yahoo Finance, returning the specified column over the given date range. Params: tickers (list of str), start\_date (str, optional), end\_date (str, optional), period (str, default='max'), column (str, default='Close')                                             | `Any`                   |
| `wavelet-mean-reversion-strategy-backtest-simple`  | Simple backtest of the strategy.                                                                                                                                                                                                                                                                                                     | `Any`                   |
| `config-from-dict`                                 | Create configuration from dictionary.                                                                                                                                                                                                                                                                                                | `Any`                   |
| `wavelet-mean-reversion-strategy-fit`              | Fit the strategy by analyzing the signal.                                                                                                                                                                                                                                                                                            | `Any`                   |
| `synthetic-data-generator-generate-mean-reverting` | Generates synthetic mean-reverting time series data using Ornstein-Uhlenbeck process parameters. Params: N (default: 1000): number of data points; theta (default: 0.1): mean reversion speed; mu (default: 0.0): long-term mean; sigma (default: 1.0): volatility; seed (default: 42): random seed for reproducibility              | `Any`                   |
| `synthetic-data-generator-generate-trending`       | Generates synthetic trending financial data using a mean-reverting model with configurable parameters for length, drift, and volatility. Params: Inputs: N (int, default 1000), drift (float, default 0.01), volatility (float, default 1.0), seed (Optional\[int], default 42)                                                      | `Any`                   |
| `wavelet-visualizer-plot-trading-signals`          | Plot trading signals on price chart.                                                                                                                                                                                                                                                                                                 | `Any`                   |
| `wavelet-visualizer-plot-backtest-results`         | Plot backtest performance.                                                                                                                                                                                                                                                                                                           | `Any`                   |
| `synthetic-data-generator-generate-complex-signal` | Generates a synthetic complex signal for wavelet analysis, producing N data points with optional random seed and component breakdown. Params: N (int, default=2000): number of data points; seed (int, optional, default=42): random seed; include\_components (bool, default=False): whether to return individual signal components | `Any`                   |
| `synthetic-data-generator-add-noise`               | Adds random noise to a signal array using a configurable noise level and optional seed for reproducibility. Params: signal (np.ndarray): input signal to add noise to; noise\_level (float, default 0.1): amplitude of added noise; seed (Optional\[int], default None): random seed for reproducibility                             | `Any`                   |
| `config-to-dict`                                   | Convert configuration to dictionary.                                                                                                                                                                                                                                                                                                 | `Any`                   |
| `wavelet-visualizer-plot-complete-analysis`        | Create comprehensive analysis visualization.                                                                                                                                                                                                                                                                                         | `Any`                   |
| `wavelet-visualizer-plot-acf-analysis`             | Plot autocorrelation function for each scale.                                                                                                                                                                                                                                                                                        | `Any`                   |
| `wavelet-visualizer-plot-monte-carlo-results`      | Plot Monte Carlo simulation results.                                                                                                                                                                                                                                                                                                 | `Any`                   |
| `wavelet-decomposition-result-get-scale-signal`    | Extracts the signal for a specific wavelet scale from decomposition results. Params: scale\_name (str): name of the wavelet scale to extract signal from (e.g., 'D1', 'D2')                                                                                                                                                          | `Any`                   |
| `trading-signal-to-dataframe`                      | Convert signals to DataFrame.                                                                                                                                                                                                                                                                                                        | `Any`                   |
| `wavelet-analysis-result-summary`                  | Generates a concise summary of wavelet analysis results, providing key metrics and insights from the wavelet decomposition and mean reversion analysis. Params: none                                                                                                                                                                 | `Any`                   |
| `wavelet-analysis-result-get-statistics-dataframe` | Retrieves statistical data from wavelet analysis results as a pandas DataFrame, providing summary metrics for mean reversion analysis. Params: none                                                                                                                                                                                  | `Any`                   |
| `main-main`                                        | Run all examples.                                                                                                                                                                                                                                                                                                                    | `Any`                   |
| `validate-time-series`                             | Validates and converts time series data to a 1D numpy array, ensuring it has at least 4 points and contains no NaN or inf values. Params: data (Union\[np.ndarray, pd.Series]): Time series data to validate                                                                                                                         | `np.ndarray`            |
| `compare-with-bollinger-bands`                     | Compares a wavelet-based mean-reverting component with traditional Bollinger Bands, returning metrics for both approaches. Params: signal: Original signal array; wavelet\_mr\_component: Wavelet-derived mean-reverting component; window: Bollinger Band window (default 20); num\_std: Std deviation multiplier (default 2.0)     | `Dict[str, np.ndarray]` |
| `example-synthetic-data`                           | Example using synthetic data.                                                                                                                                                                                                                                                                                                        | `Any`                   |
| `example-real-market-data`                         | Example using real market data.                                                                                                                                                                                                                                                                                                      | `Any`                   |
| `example-monte-carlo-backtest`                     | Example with Monte Carlo backtesting.                                                                                                                                                                                                                                                                                                | `Any`                   |
| `example-multiple-tickers`                         | Example analyzing multiple tickers.                                                                                                                                                                                                                                                                                                  | `Any`                   |
| `example-custom-configuration`                     | Example using custom configuration.                                                                                                                                                                                                                                                                                                  | `Any`                   |
| `default-config`                                   | Preset factory: create Config via ObjectStore (handles) with default deps (none); returns a handle.                                                                                                                                                                                                                                  | `object`                |
| `monte-carlo-default`                              | Preset factory: create MonteCarloBacktester via ObjectStore (handles) with default deps (none); returns a handle.                                                                                                                                                                                                                    | `object`                |
| `statistical-analyzer-default`                     | Preset factory: create StatisticalAnalyzer via ObjectStore (handles) with default deps (none); returns a handle.                                                                                                                                                                                                                     | `object`                |
| `wavelet-analyzer-default`                         | Preset factory: create WaveletAnalyzer via ObjectStore (handles) with default deps (none); returns a handle.                                                                                                                                                                                                                         | `object`                |
| `wavelet-strategy-default`                         | Preset factory: create WaveletMeanReversionStrategy via ObjectStore (handles) with default deps (analyzer); returns a handle.                                                                                                                                                                                                        | `object`                |
| `wavelet-visualizer-default`                       | Preset factory: create WaveletVisualizer via ObjectStore (handles) with default deps (none); returns a handle.                                                                                                                                                                                                                       | `object`                |
| `yahoo-fetcher-default`                            | Preset factory: create YahooDataFetcher via ObjectStore (handles) with default deps (none); returns a handle.                                                                                                                                                                                                                        | `object`                |

## Examples

### Fetch returns for one ticker

```json theme={null}
{
  "request": {
    "ticker": "AAPL",
    "start_date": "2024-01-01",
    "end_date": "2024-06-30",
    "period": "1y",
    "log_returns": true
  }
}
```

### Analyze a signal

```json theme={null}
{
  "request": {
    "signal": [
      101.0,
      100.5,
      100.9,
      100.1,
      99.8,
      100.2
    ]
  }
}
```

## Notes

* Instance-style tools can use handles when you need configured analyzers or strategies.
* Use Parallax ExtremeHurst when you need the ExtremeHurst signal engine rather than wavelet decomposition.

<CardGroup cols={2}>
  <Card title="Client setup" icon="plug" href="/quantx/servers/deployed/client-setup">
    Configure this endpoint in Cursor, Claude Desktop, or a generic MCP client.
  </Card>

  <Card title="Shared tools" icon="wrench" href="/quantx/servers/deployed/shared-tools">
    Use health, result, artifact, environment, and table helper tools.
  </Card>
</CardGroup>

## Other Servers

<CardGroup cols={3}>
  <Card title="Dataloader" icon="server" href="/quantx/servers/dataloader">
    Market-data retrieval, TA-Lib indicators, and dataframe exports.
  </Card>

  <Card title="Fama-French Replicate" icon="server" href="/quantx/servers/fama-french-replicate">
    Official and replicated Fama-French factors plus loadings and alpha estimation.
  </Card>

  <Card title="Statistical Factor Models" icon="server" href="/quantx/servers/statistical-factor-models">
    Stock-Watson, complete-panel, and dynamic statistical factor extraction.
  </Card>

  <Card title="Jump Models" icon="server" href="/quantx/servers/jump-models">
    JumpModel and SparseJumpModel regime fitting, online prediction, and backtesting.
  </Card>

  <Card title="Parallax ExtremeHurst" icon="server" href="/quantx/servers/parallax-extreme-hurst">
    ExtremeHurst signal generation from OHLCV data.
  </Card>

  <Card title="EP Ratio Screener" icon="server" href="/quantx/servers/ep-ratio-screener">
    Fundamental stock screening based on earnings yield and balance-sheet quality.
  </Card>

  <Card title="Volatility Scaling Lab" icon="server" href="/quantx/servers/volatility-scaling-lab">
    Volatility targeting, EWMA volatility, Monte Carlo bands, and risk diagnostics.
  </Card>
</CardGroup>
