# Phenomenal X Signal Engine v2.2

This is the external signal engine for the Phenomenal X MT5 EA. MT5 sends recent candles for the selected chart symbol, and the engine returns a simple signal:

- `BUY`
- `SELL`
- `CLOSE`
- `HOLD`

The v2.2 engine uses profile-aware entry gates. Each pair can select a strategy profile from the admin dashboard, and the selected profile changes the market conditions required before the engine returns `BUY` or `SELL`. Weak candle-only and trend tie-breaker entries have been removed.

## API

Health:

```bash
curl -i http://127.0.0.1:3090/api/health
```

Admin dashboard:

```text
https://engine.muxiyeto.com/admin
```

The admin dashboard includes:

- Live signal stream status from MT5 EA requests
- Recent signal logs by account and symbol
- Per-pair strategy profiles and confidence settings
- Direct strategy dropdowns for every configured pair
- Password changes from the Security tab
- PhenoFutures signal/setup tab for futures instruments and prop-firm mode
- Broker market API storage and connectivity testing
- Global strategy controls for volatility, spread, and confidence filters

Default service credentials are controlled by environment variables:

```text
PX_ENGINE_ADMIN_USER=admin
PX_ENGINE_ADMIN_PASS=Change-Me-Now
PX_ENGINE_ADMIN_SECRET=PX-ENGINE-ADMIN-SECRET-CHANGE-ME
```

Use the environment password for the first login, then change it from the dashboard Security tab.

Signal:

```bash
curl -i -X POST http://127.0.0.1:3090/api/signal \
  -H "Authorization: Bearer PX-ENGINE-TOKEN-CHANGE-ME" \
  -H "Content-Type: application/json" \
  --data '{"symbol":"EURUSD","timeframe":"PERIOD_M15","candles":[]}'
```

The MT5 EA expects a `text/plain` response:

```text
ok=1
signal=BUY
confidence=0.75
strategy=Trend Pullback
reason=trend-up, rsi-buy, macd-buy
slPips=45
tpPips=90
```

## Apache Deployment

Recommended server directory:

```text
/var/www/muxiyeto-com/engine
```

Recommended domain:

```text
https://engine.muxiyeto.com
```

The EA must allow this URL in MetaTrader:

```text
https://engine.muxiyeto.com
```

MetaTrader path:

```text
Tools > Options > Expert Advisors > Allow WebRequest for listed URL
```
