v4.2 Autonomous Engine5 Safety Pillars ActiveZero Float Drift

PSX Bot Documentation Portal

Welcome to the official manual for the Pakistan Stock Exchange (PSX) Autonomous Trading Engine. Designed so both algorithmic traders and beginners can understand every calculation, risk guard, and execution path.

← Back to Dashboard
How Your Bot Operates (At a Glance)
End-to-End Latency: < 20ms
1. TradingView
Pine Script Alert
Sends HTTPS Webhook with Action, Ticker & Price
2. Backend Mutex
15s Safety Lock
Prevents race conditions if two signals arrive at once
3. The 5 Pillars
Risk & FIFO Sizing
Validates capital in RAM & cancels old orders in parallel
4. PSX Exchange
Hardware Execution
Places physical BUY, SELL & Stop-Loss (type: 4) orders

Core Architectural Guides (New in v4.2)

Select a topic to view step-by-step visual documentation

Operator Manuals & Integration Reference

Simple Summary: Your Responsibility vs. The Bot's Responsibility

Task / DecisionWhat You Do in TradingViewWhat Your Bot Does Automatically
Deciding When to TradeConfigure your indicators and set up alert webhooks.✅ Receives signal in <10ms and validates market status.
How Many Shares to BuyNothing! Never hardcode numbers in Pine Script.✅ Dynamically sizes shares based on your cash balance that millisecond.
Placing Stop-Loss ProtectionInclude your desired SL price in the webhook alert.✅ Places physical Stop-Loss (type: 4) at PSX so you are safe offline.
Taking Profit Without RejectionsSend a standard SELL signal when profit target is hit.✅ Automatically cancels active stop order first, then sells immediately!