LLM Trading Agent Flow
Event triggert ein LLM. Das LLM nutzt Prompt, Skills und Tools für Research, baut eine Trade-These, läuft durch Confidence/Risk-Gates und führt nur dann über MEXC Futures aus.
Mermaid · Architecture Sketch
flowchart LR %% Event / orchestration EVT[[Event Trigger
Cron · Webhook · Price Alert · News Spike]] --> ORCH[Agent Orchestrator] ORCH --> PROMPT[System Prompt / Policy
Mandat · Verhalten · No-Trade-Regeln] ORCH --> LLM((LLM Core
Reasoning + Tool Use)) PROMPT --> LLM %% Context + skills subgraph SKILLS[Skills / Knowledge] S1[Twitter/X Research Playbook] S2[Chart Pattern Playbook] S3[Funding/OI Interpretation] S4[Geopolitical News Filter] S5[Risk & Position Sizing Rules] S6[MEXC Futures Execution Rules] end SKILLS --> LLM %% Research tools subgraph RESEARCH[Research Tool Layer] T1[Twitter/X Search
sentiment · influential accounts] T2[Market Data
price · volume · volatility] T3[Chart Tools
trend · support/resistance · patterns] T4[Derivatives Data
funding rates · open interest · liquidations] T5[News Tools
macro · geopolitical · regulatory] T6[Portfolio Context
current exposure · history · journal] end LLM -->|call tools| RESEARCH RESEARCH -->|observations| LLM %% Thesis LLM --> THESIS[Trade Thesis
direction · setup · invalidation · timeframe] THESIS --> CONF[Confidence Model
signal score · source agreement · uncertainty] THESIS --> RISK[Risk Model
max loss · leverage cap · stop distance] CONF --> GATE{Confidence
above threshold?} RISK --> GATE2{Risk acceptable?
RR · liquidation buffer · exposure} GATE -- no --> NOTRADE[No Trade
log rationale + wait] GATE2 -- no --> NOTRADE GATE -- yes --> PLAN[Execution Plan
symbol · side · size · entry · stop · take profit] GATE2 -- yes --> PLAN %% Exchange tools subgraph MEXC[MEXC Futures Tool Layer] E1[Read Balance] E2[Read Open Positions] E3[Read Open Orders] E4[Check Symbol Rules
min size · tick size · leverage] E5[Set Leverage / Margin Mode] E6[Place Order] E7[Place Stop Loss / Take Profit] E8[Cancel / Reduce / Close Position] end PLAN --> PRECHECK[Pre-Trade Checks
balance · existing trades · duplicate exposure] PRECHECK --> MEXC MEXC --> PRECHECK PRECHECK --> OK{All checks pass?} OK -- no --> NOTRADE OK -- yes --> EXEC[Execute Trade] EXEC --> E5 --> E6 --> E7 %% Monitoring E7 --> MON[Post-Trade Monitor
PnL · funding · news changes · stop/TP status] MON --> UPDATE{Thesis changed?} UPDATE -- no --> MON UPDATE -- yes --> ADJUST[Adjust / Reduce / Exit] ADJUST --> E8 MON --> JOURNAL[Trade Journal
inputs · decision · tool outputs · result] NOTRADE --> JOURNAL classDef core fill:#172554,stroke:#38bdf8,color:#e0f2fe,stroke-width:1px; classDef tool fill:#111827,stroke:#64748b,color:#f8fafc; classDef risk fill:#422006,stroke:#f59e0b,color:#fffbeb; classDef danger fill:#3f0b0b,stroke:#ef4444,color:#fee2e2; classDef ok fill:#052e16,stroke:#22c55e,color:#dcfce7; class LLM,ORCH,PROMPT core; class T1,T2,T3,T4,T5,T6,E1,E2,E3,E4,E5,E6,E7,E8,S1,S2,S3,S4,S5,S6 tool; class CONF,RISK,GATE,GATE2,PRECHECK,OK risk; class NOTRADE danger; class EXEC,MON,JOURNAL,PLAN,THESIS ok;
WichtigDas LLM entscheidet nicht blind. Es muss erst Daten sammeln, These formulieren und Gates bestehen.
ToolsResearch-Tools und Exchange-Tools sind getrennt: Analyse ≠ Ausführung.
Risk GateConfidence, Positionsgröße, Leverage, Stop und Liquidation-Buffer kommen vor jedem Order.
No-Trade„Nicht handeln“ ist ein gültiges Ergebnis und wird genauso geloggt.