← Back to Documentation Hub
v4.2 Core Architecture100% Autonomous
The 5 Safety Pillars of Autonomous PSX Execution
How the bot eliminates race conditions, broker rejections, short-selling errors, and ledger drift so you never need to intervene manually.
Why This Matters (In Plain English)
In stock trading, computer programs can fail if two signals arrive at the same time, if the internet slows down, or if the broker rejects an order. Our bot is built on 5 Safety Pillars that act like bulletproof guardrails. It ensures that every share bought is tracked, no share is ever sold twice, and your account balance is mathematically perfect down to the last paisa.
Zero Double-Selling
Prevents broker rejection errors by locking shares until cancelled.
Sub-Millisecond Exits
Cancels open buy orders in parallel so sell orders send instantly.
Exact Paisa Precision
Truncates JavaScript decimals so your ledger never drifts over time.
Legacy Architecture vs. v4.2 Autonomous Engine
| Technical Challenge | Legacy Systems (Risky) | v4.2 Autonomous 5 Pillars |
|---|---|---|
| Simultaneous Signals (Race Conditions) | Unsynchronized execution leads to double-selling and broker errors. | ✅ Pillar 1: Per-Ticker Mutex Lock with 15-second Deadlock Timeout. |
| Order Cancellation Latency | Sequential loop adds 50–100ms delay per order before selling. | ✅ Pillar 2: Parallel Non-Blocking Broker Cancellation via Account Memory. |
| Broker Holding Verification | Slow database query blocks hot-path execution during volatility. | ✅ Pillar 3: Zero-DB In-Memory Holding Cache (Sub-millisecond access). |
| Capital Calculation Drift | JavaScript double floats drift by micro-paisa over 1,000+ trades. | ✅ Pillar 4: Exact .toFixed(2) truncate math on all refunds & reserves. |
| Pyramiding & Multiple Lots | Sells entire position or wrong lot when multiple alerts trigger. | ✅ Pillar 5: True FIFO Chronological Lot Allocation & Aggregate Exits. |