Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Orchestration Flows

A. Automated trading pipeline

One optional range strategy can be triggered on demand:

A1. MR Combined (on demand)

┌─────────────────────────────────────────────────────────────────┐
│  MANUAL / TOOL-TRIGGERED                                         │
│   │                                                             │
│   ▼                                                             │
│  scout ──► POST /api/mr-combined/scan-and-signal                │
│   │        HTF/MTF context gate                                 │
│   │        4H range validation                                  │
│   │        1H setup near support/resistance                     │
│   │        pending signal with TP1/TP2 + range levels          │
│   │                                                             │
│   │  signal?                                                    │
│   ├── NO  → end                                                 │
│   │                                                             │
│   ▼  YES                                                        │
│  bot ──► Telegram ──► boss  🔍 MR COMBINED SIGNAL               │
│                          │  YES or NO?                          │
│               NO ──► REJECTED → skip                           │
│                         YES ──► finance                         │
│                          │  AI Confirm (EV > 25%, C ≥ 8)       │
│                          ▼                                      │
│                  POST /trade → bracket order                    │
│                  finance ──► Telegram 🟢 ORDER PLACED           │
└─────────────────────────────────────────────────────────────────┘

B. Trailing stop (cron every 1 minute)

CRON every 1m
  │
  ▼
finance ──► GET /trailing
  │
  │  updated.count > 0?
  ├── NO  → ANNOUNCE_SKIP
  │
  └── YES ──sessions_send──► coo ──► Telegram
                                     📈 TRAILING STOP
                                     BTC: SL $X → $Y

C. Health check (cron every 1 hour)

CRON every 1h
  │
  ▼
ops ──► GET /status
  │
  │  anomaly?
  ├── NO  → ANNOUNCE_SKIP
  │
  └── YES ──sessions_send──► coo ──► Telegram
                                     ⚠️ SYSTEM ALERT

D. Daily PnL report (cron 21:00)

CRON 21:00
  │
  ▼
finance ──► GET /status
  │
  ▼
finance ──sessions_send──► coo ──► Telegram
                                   📊 Daily Report
                                   Win/Loss, PnL%

E. Drawdown alert (realtime)

finance (trailing loop)
  │  loss > 15% detected
  ▼
finance ──sessions_send──► coo ──► Telegram
                                   🚨 DRAWDOWN ALERT > 15%
                                   automated trading paused

F. Manual request from boss

boss ──► Telegram ──► coo
                                 │
                          routing table:
                          ┌──────────────────────────┬─────────┐
                          │ trade/AI confirm/execute  │ finance │
                          │ PnL/risk/drawdown/signal  │ finance │
                          │ TA scan/signal            │  scout  │
                          │ health/infra/watchdog     │   ops   │
                          │ backend/code/bug fix      │  tech   │
                          └──────────────────────────┴─────────┘
                                 │
                          sessions_send → agent
                                 │
                          result → coo → format → boss