[Backend] Simulate Engine - Real-time Signal Detection #8

Closed
opened 2026-04-06 00:29:44 +02:00 by shoko · 0 comments
Owner

Overview

Implement the simulate engine for real-time signal detection via REST polling.

Dependencies

  • Requires Backtest Engine (issue #7) to be completed first

Tasks

  • Create simulate engine service
  • Implement REST polling for current prices
  • Create condition matching for real-time data
  • Add configurable check interval (default 60s for free tier)
  • Create signal logging
  • Implement user-initiated start/stop
  • Create simulation API endpoints
  • Add auto_execute flag support (future)
  • Add simulation signal history

API Endpoints

  • POST /api/bots/{id}/simulate - Start simulation
  • GET /api/bots/{id}/simulate/{run_id} - Get status/signals
  • GET /api/bots/{id}/simulations - List all simulations
  • POST /api/bots/{id}/simulate/{run_id}/stop - Stop simulation

User Notice

Display this to free tier users:
REST polling every 60s. Pro tier users get WebSocket real-time signals.

Algorithm

  1. Load bot strategy_config
  2. Start loop (user-initiated):
    a. Fetch current prices via REST
    b. Check conditions
    c. If met, generate signal and log
    d. Wait N seconds
  3. Stop when user stops
## Overview Implement the simulate engine for real-time signal detection via REST polling. ## Dependencies - Requires **Backtest Engine** (issue #7) to be completed first ## Tasks - [ ] Create simulate engine service - [ ] Implement REST polling for current prices - [ ] Create condition matching for real-time data - [ ] Add configurable check interval (default 60s for free tier) - [ ] Create signal logging - [ ] Implement user-initiated start/stop - [ ] Create simulation API endpoints - [ ] Add auto_execute flag support (future) - [ ] Add simulation signal history ## API Endpoints - POST /api/bots/{id}/simulate - Start simulation - GET /api/bots/{id}/simulate/{run_id} - Get status/signals - GET /api/bots/{id}/simulations - List all simulations - POST /api/bots/{id}/simulate/{run_id}/stop - Stop simulation ## User Notice Display this to free tier users: REST polling every 60s. Pro tier users get WebSocket real-time signals. ## Algorithm 1. Load bot strategy_config 2. Start loop (user-initiated): a. Fetch current prices via REST b. Check conditions c. If met, generate signal and log d. Wait N seconds 3. Stop when user stops
shoko added this to the Phase 1 - Core MVP milestone 2026-04-06 00:29:44 +02:00
shoko added the backendenhancement labels 2026-04-06 00:29:44 +02:00
shoko closed this issue 2026-04-08 14:57:29 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/randebu#8