# Trading Signals

Noelclaw generates daily 1H trading signals for BTC and ETH, tracks outcomes automatically, and delivers a weekly recap every Sunday — all without any manual input.

***

## How Signals Work

Signals are generated once per day at **08:00 UTC** using the Bankr LLM gateway. Each signal covers the **1H timeframe** and includes:

| Field       | Description                                       |
| ----------- | ------------------------------------------------- |
| Token       | BTC or ETH                                        |
| Signal      | BUY or SELL                                       |
| Entry price | Recommended entry zone                            |
| TP1 / TP2   | Two take-profit targets                           |
| Stop loss   | Risk management level                             |
| Confidence  | Score from 0–100                                  |
| Rationale   | 1H RSI, MACD, Bollinger Bands, support/resistance |

***

## Signal Generation

The signal engine (`signalEngine.ts`) runs via Convex cron at `0 8 * * *`. It:

1. Sends a structured 1H market analysis prompt to Bankr LLM
2. Parses the JSON response for entry, TP1, TP2, SL, confidence
3. Saves the signal to the `tradingSignals` table
4. Sends a Telegram notification with the full signal card

**Telegram signal card format:**

```
⚡️ NOEL SIGNAL — BTC

📊 Timeframe: 1H
🟢 Signal: BUY
💵 Entry: $103,000
🎯 TP1: $105,000 (+1.94%)
🎯 TP2: $107,500 (+4.37%)
🛑 Stop Loss: $101,200 (-1.75%)
📈 Confidence: 82%

📝 Rationale:
1H RSI at 54, MACD bullish crossover forming.
Price consolidating above key support at $102,800.
```

***

## Outcome Tracking

Every 30 minutes, the outcome tracker checks open signals against live price data:

* **Win**: Price hit TP1 before stop loss → signal marked `WIN`, PnL calculated
* **Loss**: Price hit stop loss → signal marked `LOSS`, PnL calculated
* **Expired**: Signal older than 6 hours with no outcome → marked `EXPIRED`

Outcomes are stored back in `tradingSignals` and factored into win rate statistics.

***

## Weekly Recap

Every Sunday at **23:55 UTC**, Noelclaw generates a full weekly recap covering Monday through Sunday.

The recap includes:

* Full 7-day signal log (BTC and ETH, one per day)
* Total wins, losses, and win rate for the week
* Best and worst performing signals (PnL)
* AI-written performance review from Bankr

**Telegram weekly recap format:**

```
📊 NOEL WEEKLY RECAP
Week of May 6–12, 2026

📅 SIGNAL LOG

Mon ₿: 🟢 BUY $103,000 → TP1 (+2.50%)
Mon Ξ: 🔴 SELL $3,850 → SL (-1.50%)
Tue ₿: 🟢 BUY $104,200 → TP1 (+1.94%)
Tue Ξ: 🟢 BUY $3,900 → TP2 (+4.10%)
Wed ₿: ⚪ No signal
...

📈 BTC WEEK RESULTS
Signals: 5 | ✅ Wins: 4 | ❌ Losses: 1
Win Rate: 80.00%
Best: +3.20% | Worst: -1.50% | Avg: +1.85%

📊 ETH WEEK RESULTS
Signals: 5 | ✅ Wins: 3 | ❌ Losses: 2
Win Rate: 60.00%
Best: +4.10% | Worst: -1.75% | Avg: +0.92%

🤖 AI WEEKLY REVIEW
[Bankr AI analysis of the week's performance...]
```

Weekly recaps are stored in the `weeklyRecaps` table and sent to the configured Telegram bot.

***

## Accessing Signals via MCP

**Latest signal:**

```
get_latest_signal(token: "BTC")
get_latest_signal(token: "ETH")
get_latest_signal  # returns both
```

**Signal history with winrate:**

```
get_signal_history(token: "BTC", limit: 14)
```

**Today's recap:**

```
get_daily_recap
```

***

## Database Tables

| Table            | Purpose                                    |
| ---------------- | ------------------------------------------ |
| `tradingSignals` | Individual signals with outcome tracking   |
| `weeklyRecaps`   | Sunday recap with full 7-day log and stats |

**`tradingSignals` fields:**

```
token: "BTC" | "ETH"
signal: "BUY" | "SELL"
entry, tp1, tp2, stopLoss: number
confidence: number (0–100)
timeframe: "1H"
rationale: string
outcome: "WIN" | "LOSS" | "EXPIRED" | "PENDING"
pnl: number
generatedAt: number
```

***

## Configuration

Signals run automatically — no setup required. To receive them via Telegram:

```
set_telegram(
  userId: "your-id",
  telegramBotToken: "...",
  telegramChatId: "..."
)
```

The signal cron and weekly recap cron run server-side regardless of whether any users are active. Signals are generated and saved even with no Telegram configured — they remain accessible via MCP tools and the platform UI.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.noelclaw.fun/core-features/signals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
