1.8 KiB
1.8 KiB
Finlytic Trades Service
Finlytic Trades is a C# microservice managing the full lifecycle of automated trade signals and positions. It handles proposed trade validation, position tracking, TTL expiration, hourly performance updates, and trade closure.
Core Modules & Architecture
-
Trade Lifecycle Engine (
ITradeLifecycleService):- Ingests trade proposals (
TradeProposalDto), validates parameters (Entry, Stop Loss, Take Profit, Win Rate, Risk Tolerance), and tracks positions throughActive,Closed,Expired, orCancelledstates.
- Ingests trade proposals (
-
TTL Worker Service (
TtlWorkerService):- Periodically checks active trades against Time-To-Live (
TtlMinutes) constraints and automatically expires stale trades.
- Periodically checks active trades against Time-To-Live (
-
Feedback Exporter Engine (
FeedbackExporterEngine):- Exports trade outcome data (
TradeFeedbackRecord) for AI model retraining and win-rate calibration.
- Exports trade outcome data (
-
MQTT RPC & Event Communication:
- Subscribes to
finlytic/trades/proposed/#andfinlytic/trades/updates/#. - Handles RPC requests on
finlytic/trades/get_active/requestandfinlytic/trades/close/request/#. - Publishes position updates to
finlytic/trades/updateandfinlytic/trades/get_active/response.
- Subscribes to
Feature Status
Implemented Features
- Full Trade Lifecycle Management (
TradesDbContextwith PostgreSQL indexes). - Automated TTL Expiration Worker (
TtlWorkerService). - AI Feedback Record Exporter (
FeedbackExporterEngine). - Pure Worker Service Architecture (
Host.CreateApplicationBuilder, Kestrel HTTP server removed). - Zero-Allocation MQTT RPC handlers for active trades & trade closure.
Planned Features
- Automated Trailing Stop Loss adjustment engine based on ATR (Average True Range).
- Direct Broker API Execution integration (Trade Republic / Interactive Brokers automated order placement).