# Mean-Reversion Ensemble Strategy AI Agent Connect

> An algorithmic trading engine that uses an ensemble of RSI, Bollinger Bands, and Z-Score to identify high-probability mean-reversion entries.

## Overview
- **Category:** finance
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_Kwoyg1w3qZwgw3BsLLUiOkZXQtyWdKpQJAZT3g0I/ai-agent-connect
- **Tags:** mean-reversion, rsi, bollinger-bands, z-score, algorithmic-trading

## Description

This MCP server provides a deterministic ensemble strategy for identifying mean-reversion opportunities. By aggregating three distinct technical indicators--RSI, Bollinger Bands, and Z-Score--the engine confirms extreme market conditions through an ensemble scoring mechanism. Users can use `calculate_ensemble_signals` to generate technical indicators, `generate_trading_plan` to derive specific entry and exit parameters, and `analyze_reversion_probability` to evaluate the historical success rate of specific ensemble scores. This approach ensures that trades are only initiated when multiple signals align, reducing the risk of false signals in volatile markets.

## Tools

### calculate_ensemble_signals


### analyze_reversion_probability


### generate_trading_plan


## Prompt Examples

**Prompt:** 
```
Generate technical signals for these closing prices: [150.2, 148.5, 145.0, 142.1, 140.5, 141.2, 143.5]
```

**Response:** 
```
The signal series has been generated. The final bar shows an oversoldScore of 3, indicating a potential BUY signal.
```

**Prompt:** 
```
Create a trading plan for the following signal series: [{"timestamp": 1625097600, "rsi": 25, "bbLower": 145, "bbUpper": 160, "zScore": -2.5, "oversoldScore": 3, "overboughtScore": 0, "signalType": "BUY"}]
```

**Response:** 
```
The trading plan is ready. Entry Price: 140.5, Stop-Loss: 136.38, Take-Profit: 150.2.
```

**Prompt:** 
```
What is the historical probability of reversion for an ensemble score of 3?
```

**Response:** 
```
Based on the provided signal series, an ensemble score of 3 has a historical reversion probability of 68.5%.
```

## Frequently Asked Questions

**What is an ensemble score in this strategy?**
The ensemble score is a count (0 to 3) of how many indicators (RSI, Bollinger Bands, and Z-Score) simultaneously signal an extreme oversold or overbought condition.

**When does the strategy trigger a BUY signal?**
A BUY signal is triggered only when the `oversoldScore` reaches exactly 3, meaning RSI, Bollinger Bands, and Z-Score all confirm an oversold state.

**How is the stop-loss calculated?**
The stop-loss is determined by the higher of a 3% drop from the entry price or the price level where the ensemble score drops to 1.
