| <?xml version="1.0" encoding="UTF-8"?> |
| <mxfile host="app.diagrams.net" modified="2026-03-09T19:02:00.000Z" agent="draw.io" version="21.0.0"> |
| <diagram id="trading-logic" name="Trading Logic Flow v2"> |
| <mxGraphModel dx="1600" dy="1200" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="1800" pageHeight="1600" math="0" shadow="0"> |
| <root> |
| <mxCell id="0" /> |
| <mxCell id="1" parent="0" /> |
| |
| |
| <mxCell id="title" value="<b>DRL Trading System v2.1 — Complete Trade Logic Flow</b><br><i>Updated: 2026-03-09</i>" style="text;html=1;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;whiteSpace=wrap;rounded=0;fontSize=16;" vertex="1" parent="1"> |
| <mxGeometry x="550" y="10" width="500" height="40" as="geometry" /> |
| </mxCell> |
| |
| |
| |
| |
| |
| |
| <mxCell id="start" value="⏰ Trading Cycle
(Every 60s)" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;fontStyle=1" vertex="1" parent="1"> |
| <mxGeometry x="720" y="60" width="140" height="60" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="fetch" value="📊 Fetch 14-Day OHLCV
from Binance" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=11;" vertex="1" parent="1"> |
| <mxGeometry x="715" y="140" width="150" height="40" as="geometry" /> |
| </mxCell> |
| <mxCell id="e1" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="start" target="fetch"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="limitfill" value="🎯 Check Pending
Limit Orders
(Split-Entry)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e6d0de;strokeColor=#996185;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="715" y="200" width="150" height="45" as="geometry" /> |
| </mxCell> |
| <mxCell id="e1b" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="fetch" target="limitfill"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="checkpos" value="In Position?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=11;" vertex="1" parent="1"> |
| <mxGeometry x="725" y="265" width="130" height="60" as="geometry" /> |
| </mxCell> |
| <mxCell id="e2" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="limitfill" target="checkpos"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="sltp" value="🛡️ Check Exits
SL / TP / Trailing" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=11;" vertex="1" parent="1"> |
| <mxGeometry x="960" y="260" width="130" height="45" as="geometry" /> |
| </mxCell> |
| <mxCell id="e3" style="edgeStyle=orthogonalEdgeStyle;exitX=1;exitY=0.5;" edge="1" parent="1" source="checkpos" target="sltp"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="yespos" value="YES" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=1;fontColor=#009900" vertex="1" parent="1"> |
| <mxGeometry x="870" y="275" width="30" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="sltphit" value="Exit
Triggered?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="975" y="330" width="100" height="55" as="geometry" /> |
| </mxCell> |
| <mxCell id="e4" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="sltp" target="sltphit"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="closepos" value="❌ CLOSE
Record P&L
Clear Pending Orders" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=10;fontStyle=1" vertex="1" parent="1"> |
| <mxGeometry x="1120" y="330" width="130" height="55" as="geometry" /> |
| </mxCell> |
| <mxCell id="e5" style="edgeStyle=orthogonalEdgeStyle;exitX=1;exitY=0.5;" edge="1" parent="1" source="sltphit" target="closepos"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="yeshit" value="YES" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=1;fontColor=#009900" vertex="1" parent="1"> |
| <mxGeometry x="1080" y="345" width="30" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="flattext" value="FLAT" style="text;html=1;strokeColor=none;fillColor=none;fontSize=10;fontStyle=2" vertex="1" parent="1"> |
| <mxGeometry x="755" y="330" width="40" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| |
| |
| |
| <mxCell id="model" value="🤖 PPO Model
Prediction
(150+ Features)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=11;fontStyle=1" vertex="1" parent="1"> |
| <mxGeometry x="715" y="370" width="150" height="50" as="geometry" /> |
| </mxCell> |
| <mxCell id="e6" style="edgeStyle=orthogonalEdgeStyle;exitX=0.5;exitY=1;" edge="1" parent="1" source="checkpos" target="model"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="e6b" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="sltphit" target="model"> |
| <mxGeometry relative="1" as="geometry"> |
| <Array as="points"> |
| <mxPoint x="1025" y="420" /> |
| <mxPoint x="790" y="420" /> |
| </Array> |
| </mxGeometry> |
| </mxCell> |
| <mxCell id="nolabel" value="NO" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=1;fontColor=#CC0000" vertex="1" parent="1"> |
| <mxGeometry x="1030" y="395" width="25" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="ppodec" value="PPO says
HOLD?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="740" y="445" width="100" height="55" as="geometry" /> |
| </mxCell> |
| <mxCell id="e7" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="model" target="ppodec"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="holdout" value="😶 HOLD
(No Action)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="585" y="455" width="90" height="35" as="geometry" /> |
| </mxCell> |
| <mxCell id="e7b" style="edgeStyle=orthogonalEdgeStyle;exitX=0;exitY=0.5;" edge="1" parent="1" source="ppodec" target="holdout"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="yeshold" value="YES" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=1;fontColor=#009900" vertex="1" parent="1"> |
| <mxGeometry x="690" y="462" width="30" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| |
| |
| |
| <mxCell id="composite_box" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e6f3ff;strokeColor=#3399ff;dashed=1;" vertex="1" parent="1"> |
| <mxGeometry x="290" y="530" width="1000" height="130" as="geometry" /> |
| </mxCell> |
| <mxCell id="composite_title" value="<b>📈 Composite Market Score (5 Weighted Signals → [-1, +1])</b>" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontSize=13;" vertex="1" parent="1"> |
| <mxGeometry x="490" y="535" width="600" height="20" as="geometry" /> |
| </mxCell> |
| |
| <mxCell id="e8" style="edgeStyle=orthogonalEdgeStyle;exitX=0.5;exitY=1;" edge="1" parent="1" source="ppodec" target="composite_box"> |
| <mxGeometry relative="1" as="geometry"> |
| <mxPoint x="790" y="530" as="targetPoint" /> |
| </mxGeometry> |
| </mxCell> |
| <mxCell id="noppo" value="BUY or SELL" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=2" vertex="1" parent="1"> |
| <mxGeometry x="795" y="510" width="70" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="sig_whale" value="🐋 Whale
Signals
<b>30%</b>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#b3d9ff;strokeColor=#3399ff;fontSize=10;fontStyle=0" vertex="1" parent="1"> |
| <mxGeometry x="310" y="560" width="100" height="55" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="sig_regime" value="📊 Market
Regime (HMM)
<b>20%</b>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#b3d9ff;strokeColor=#3399ff;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="430" y="560" width="110" height="55" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="sig_tft" value="🔮 TFT
Forecast
<b>20%</b>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#b3d9ff;strokeColor=#3399ff;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="560" y="560" width="100" height="55" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="sig_fund" value="💰 Funding
Rate
<b>15%</b>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#b3d9ff;strokeColor=#3399ff;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="680" y="560" width="100" height="55" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="sig_flow" value="📊 Order Flow
(CVD+Taker+Notable)
<b>15%</b>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#b3d9ff;strokeColor=#3399ff;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="800" y="560" width="130" height="55" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="sig_squeeze" value="🚨 Squeeze
Override
<b>+40%</b> (if active)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6b3;strokeColor=#d79b00;fontSize=9;" vertex="1" parent="1"> |
| <mxGeometry x="950" y="560" width="120" height="55" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="composite_score" value="composite = Σ(score × weight)
confidence = (composite + 1) / 2" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontSize=10;fontStyle=2" vertex="1" parent="1"> |
| <mxGeometry x="310" y="625" width="250" height="25" as="geometry" /> |
| </mxCell> |
| |
| |
| |
| |
| |
| <mxCell id="veto_box" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe0e0;strokeColor=#cc0000;dashed=1;" vertex="1" parent="1"> |
| <mxGeometry x="290" y="680" width="1000" height="100" as="geometry" /> |
| </mxCell> |
| <mxCell id="veto_title" value="<b>🚫 Hard Veto Gates (any one blocks the trade)</b>" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontSize=12;" vertex="1" parent="1"> |
| <mxGeometry x="525" y="685" width="530" height="20" as="geometry" /> |
| </mxCell> |
| |
| <mxCell id="e_comp_veto" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="composite_box" target="veto_box"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="veto_regime" value="📉 Downtrend
Veto
(block LONG)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffcccc;strokeColor=#cc0000;fontSize=9;" vertex="1" parent="1"> |
| <mxGeometry x="310" y="710" width="100" height="50" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="veto_tft" value="🔮 TFT Strong
Disagreement
Veto" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffcccc;strokeColor=#cc0000;fontSize=9;" vertex="1" parent="1"> |
| <mxGeometry x="430" y="710" width="100" height="50" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="veto_conf" value="❌ Low
Confidence
(< 0.35)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffcccc;strokeColor=#cc0000;fontSize=9;" vertex="1" parent="1"> |
| <mxGeometry x="550" y="710" width="100" height="50" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="veto_vol" value="📊 No Volume
Confirmation
(Tier 2)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffcccc;strokeColor=#cc0000;fontSize=9;" vertex="1" parent="1"> |
| <mxGeometry x="670" y="710" width="100" height="50" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="veto_liq" value="⚠️ Liquidation
Danger
(OI + Funding)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ff9999;strokeColor=#cc0000;fontSize=9;fontStyle=1" vertex="1" parent="1"> |
| <mxGeometry x="790" y="710" width="110" height="50" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="veto_cvd" value="⚡ CVD
Divergence
(Hidden Selling)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ff9999;strokeColor=#cc0000;fontSize=9;fontStyle=1" vertex="1" parent="1"> |
| <mxGeometry x="920" y="710" width="110" height="50" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="veto_block" value="→ Any veto fires = HOLD" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontSize=10;fontStyle=1;fontColor=#CC0000" vertex="1" parent="1"> |
| <mxGeometry x="1060" y="725" width="150" height="20" as="geometry" /> |
| </mxCell> |
| |
| |
| |
| |
| |
| <mxCell id="decision_box" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e6ffe6;strokeColor=#339933;dashed=1;" vertex="1" parent="1"> |
| <mxGeometry x="390" y="800" width="800" height="120" as="geometry" /> |
| </mxCell> |
| <mxCell id="decision_title" value="<b>🎯 3-Tier Decision System</b>" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontSize=13;" vertex="1" parent="1"> |
| <mxGeometry x="620" y="805" width="340" height="20" as="geometry" /> |
| </mxCell> |
| |
| <mxCell id="e_veto_dec" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="veto_box" target="decision_box"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="passedlabel" value="Passed All Vetoes" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=2" vertex="1" parent="1"> |
| <mxGeometry x="735" y="785" width="100" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="tier1" value="<b>Tier 1: SIGNAL OVERRIDE</b>
conf ≥ 0.65 + market not neutral
→ Trade even if PPO disagrees" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ccffcc;strokeColor=#339933;fontSize=9;align=left;spacingLeft=5;" vertex="1" parent="1"> |
| <mxGeometry x="410" y="830" width="200" height="55" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="tier2" value="<b>Tier 2: CONSENSUS</b>
conf ≥ 0.45
PPO agrees with market → Trade
PPO disagrees → HOLD" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ccffcc;strokeColor=#339933;fontSize=9;align=left;spacingLeft=5;" vertex="1" parent="1"> |
| <mxGeometry x="630" y="830" width="200" height="55" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="tier3" value="<b>Tier 3: LOW CONFIDENCE</b>
conf < 0.45
→ HOLD (insufficient clarity)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=9;align=left;spacingLeft=5;" vertex="1" parent="1"> |
| <mxGeometry x="850" y="830" width="200" height="55" as="geometry" /> |
| </mxCell> |
| |
| |
| |
| |
| |
| <mxCell id="collapse" value="💀 CONVICTION COLLAPSE
If LONG & composite < -0.40 → EXIT
If SHORT & composite > +0.40 → EXIT
<i>Bypasses MIN_HOLD timer</i>" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ff6666;strokeColor=#990000;fontColor=#ffffff;fontSize=10;fontStyle=1" vertex="1" parent="1"> |
| <mxGeometry x="290" y="830" width="110" height="80" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_collapse" style="edgeStyle=orthogonalEdgeStyle;dashed=1;strokeColor=#990000;" edge="1" parent="1" source="collapse" target="closepos"> |
| <mxGeometry relative="1" as="geometry"> |
| <Array as="points"> |
| <mxPoint x="250" y="870" /> |
| <mxPoint x="250" y="355" /> |
| </Array> |
| </mxGeometry> |
| </mxCell> |
| |
| |
| |
| |
| |
| <mxCell id="guard_box" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;dashed=1;" vertex="1" parent="1"> |
| <mxGeometry x="490" y="950" width="600" height="70" as="geometry" /> |
| </mxCell> |
| <mxCell id="guard_title" value="<b>🛡️ Anti-Overtrading Guards</b>" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontSize=12;" vertex="1" parent="1"> |
| <mxGeometry x="640" y="955" width="300" height="20" as="geometry" /> |
| </mxCell> |
| |
| <mxCell id="e_dec_guard" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="decision_box" target="guard_box"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| |
| <mxCell id="guard_cool" value="⏸️ Post-Loss Cooldown
(30 min after SL hit)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6b3;strokeColor=#d79b00;fontSize=9;" vertex="1" parent="1"> |
| <mxGeometry x="520" y="975" width="140" height="35" as="geometry" /> |
| </mxCell> |
| |
| <mxCell id="guard_hold" value="⏳ Min Hold Timer
(4h since entry)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6b3;strokeColor=#d79b00;fontSize=9;" vertex="1" parent="1"> |
| <mxGeometry x="700" y="975" width="130" height="35" as="geometry" /> |
| </mxCell> |
| |
| <mxCell id="guard_port" value="🛡️ Global Portfolio Mgr
(Max 2 same-direction)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6b3;strokeColor=#d79b00;fontSize=9;" vertex="1" parent="1"> |
| <mxGeometry x="870" y="975" width="150" height="35" as="geometry" /> |
| </mxCell> |
| |
| |
| |
| |
| |
| <mxCell id="exec_gate" value="All Guards Passed?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=11;" vertex="1" parent="1"> |
| <mxGeometry x="720" y="1050" width="140" height="60" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_guard_exec" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="guard_box" target="exec_gate"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="blocked_hold" value="😶 HOLD
(Guard blocked)" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="550" y="1060" width="110" height="35" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_blocked" style="edgeStyle=orthogonalEdgeStyle;exitX=0;exitY=0.5;" edge="1" parent="1" source="exec_gate" target="blocked_hold"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="nolabel2" value="NO" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=1;fontColor=#CC0000" vertex="1" parent="1"> |
| <mxGeometry x="670" y="1070" width="25" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="exec_trade" value="⚡ EXECUTE TRADE" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=12;fontStyle=1" vertex="1" parent="1"> |
| <mxGeometry x="715" y="1140" width="150" height="40" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_exec" style="edgeStyle=orthogonalEdgeStyle;exitX=0.5;exitY=1;" edge="1" parent="1" source="exec_gate" target="exec_trade"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="yeslabel3" value="YES" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=1;fontColor=#009900" vertex="1" parent="1"> |
| <mxGeometry x="775" y="1120" width="30" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="exec_type" value="Direction?" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="740" y="1200" width="100" height="50" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_exec_type" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="exec_trade" target="exec_type"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="openlong" value="✅ OPEN LONG

• Split-Entry: 50% Market
• 50% Limit @ -0.5%
• Structural SL (VWAP/Swing)
• Confidence-Scaled Size" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=10;fontStyle=1;align=left;spacingLeft=10;" vertex="1" parent="1"> |
| <mxGeometry x="440" y="1260" width="190" height="100" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_long" style="edgeStyle=orthogonalEdgeStyle;exitX=0;exitY=0.5;" edge="1" parent="1" source="exec_type" target="openlong"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="buylabel" value="BUY" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=1;fontColor=#009900" vertex="1" parent="1"> |
| <mxGeometry x="637" y="1215" width="30" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="openshort" value="✅ OPEN SHORT

• Split-Entry: 50% Market
• 50% Limit @ +0.5%
• Structural SL (VWAP/Swing)
• Confidence-Scaled Size" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=10;fontStyle=1;align=left;spacingLeft=10;" vertex="1" parent="1"> |
| <mxGeometry x="950" y="1260" width="190" height="100" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_short" style="edgeStyle=orthogonalEdgeStyle;exitX=1;exitY=0.5;" edge="1" parent="1" source="exec_type" target="openshort"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="selllabel" value="SELL" style="text;html=1;strokeColor=none;fillColor=none;fontSize=9;fontStyle=1;fontColor=#CC0000" vertex="1" parent="1"> |
| <mxGeometry x="910" y="1215" width="30" height="15" as="geometry" /> |
| </mxCell> |
| |
| |
| <mxCell id="save" value="💾 Save State
Log Trade
Update Dashboard" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=10;" vertex="1" parent="1"> |
| <mxGeometry x="722" y="1400" width="136" height="50" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_long_save" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="openlong" target="save"> |
| <mxGeometry relative="1" as="geometry"> |
| <Array as="points"> |
| <mxPoint x="535" y="1425" /> |
| </Array> |
| </mxGeometry> |
| </mxCell> |
| <mxCell id="e_short_save" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="openshort" target="save"> |
| <mxGeometry relative="1" as="geometry"> |
| <Array as="points"> |
| <mxPoint x="1045" y="1425" /> |
| </Array> |
| </mxGeometry> |
| </mxCell> |
| <mxCell id="e_close_save" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="closepos" target="save"> |
| <mxGeometry relative="1" as="geometry"> |
| <Array as="points"> |
| <mxPoint x="1300" y="357" /> |
| <mxPoint x="1300" y="1425" /> |
| </Array> |
| </mxGeometry> |
| </mxCell> |
| |
| |
| <mxCell id="loop_end" value="🔄 Sleep 60s → Next Cycle" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=10;fontStyle=2" vertex="1" parent="1"> |
| <mxGeometry x="710" y="1480" width="160" height="45" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_save_loop" style="edgeStyle=orthogonalEdgeStyle;" edge="1" parent="1" source="save" target="loop_end"> |
| <mxGeometry relative="1" as="geometry" /> |
| </mxCell> |
| <mxCell id="e_loop_start" style="edgeStyle=orthogonalEdgeStyle;dashed=1;strokeColor=#666666;" edge="1" parent="1" source="loop_end" target="start"> |
| <mxGeometry relative="1" as="geometry"> |
| <Array as="points"> |
| <mxPoint x="790" y="1550" /> |
| <mxPoint x="200" y="1550" /> |
| <mxPoint x="200" y="90" /> |
| </Array> |
| </mxGeometry> |
| </mxCell> |
| |
| |
| |
| |
| |
| <mxCell id="sltpbox" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6cc;strokeColor=#d79b00;dashed=1;" vertex="1" parent="1"> |
| <mxGeometry x="1340" y="60" width="380" height="270" as="geometry" /> |
| </mxCell> |
| <mxCell id="sltptitle" value="<b>🎯 Risk Management Details</b>" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontSize=12;" vertex="1" parent="1"> |
| <mxGeometry x="1415" y="65" width="230" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="sltpdetail" value="<div style="text-align: left;"><b>Structural Stop Losses (VWAP/Swing):</b><br>• SL placed below nearest support (VWAP or 24p low)<br>• Buffer: 0.5× ATR past the structural level<br>• Hard clipped between 1% and 10%<br>• Falls back to ATR-based if insufficient data<br><br><b>Trailing Stop:</b><br>• Activates after 1.5% unrealized gain<br>• Locks in 60% of peak gain from entry<br>• Prevents profit evaporation on reversal<br><br><b>Split-Entry Execution:</b><br>• 50% filled immediately at market<br>• 50% placed as limit order (0.5% offset)<br>• Auto-fills on natural wick → better avg price<br><br><b>Position Sizing:</b><br>• Confidence-scaled (0.5x–2.0x base size)<br>• Higher confidence → larger position</div>" style="text;html=1;strokeColor=none;fillColor=none;align=left;fontSize=9;spacingLeft=10;" vertex="1" parent="1"> |
| <mxGeometry x="1350" y="85" width="360" height="240" as="geometry" /> |
| </mxCell> |
|
|
| |
| |
| |
| |
| <mxCell id="legend" value="" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f5f5f5;strokeColor=#666666;dashed=1;" vertex="1" parent="1"> |
| <mxGeometry x="1340" y="350" width="380" height="130" as="geometry" /> |
| </mxCell> |
| <mxCell id="legendtitle" value="<b>Legend</b>" style="text;html=1;strokeColor=none;fillColor=none;align=center;fontSize=11;" vertex="1" parent="1"> |
| <mxGeometry x="1490" y="355" width="70" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg1" value="Start/End" style="ellipse;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1350" y="380" width="60" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg2" value="Process" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#dae8fc;strokeColor=#6c8ebf;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1420" y="380" width="60" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg3" value="Decision" style="rhombus;whiteSpace=wrap;html=1;fillColor=#fff2cc;strokeColor=#d6b656;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1490" y="375" width="60" height="30" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg4" value="Model" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#e1d5e7;strokeColor=#9673a6;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1560" y="380" width="60" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg5" value="Signal Source" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#b3d9ff;strokeColor=#3399ff;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1350" y="410" width="70" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg6" value="Hard Veto" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffcccc;strokeColor=#cc0000;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1430" y="410" width="60" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg7" value="Emergency" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ff6666;strokeColor=#990000;fontColor=#ffffff;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1500" y="410" width="60" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg8" value="Long Action" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#d5e8d4;strokeColor=#82b366;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1350" y="440" width="65" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg9" value="Short Action" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#f8cecc;strokeColor=#b85450;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1430" y="440" width="65" height="20" as="geometry" /> |
| </mxCell> |
| <mxCell id="leg10" value="Guard/Anti-overtrade" style="rounded=1;whiteSpace=wrap;html=1;fillColor=#ffe6b3;strokeColor=#d79b00;fontSize=8;" vertex="1" parent="1"> |
| <mxGeometry x="1510" y="440" width="100" height="20" as="geometry" /> |
| </mxCell> |
| |
| </root> |
| </mxGraphModel> |
| </diagram> |
| </mxfile> |
|
|