Hybrid Stop-Loss & Circuit Breaker Mechanics
How the bot combines hardware exchange orders with software gap-down guards to protect your capital on the Pakistan Stock Exchange.
Unlike crypto or forex where markets run 24/7 without limits, the Pakistan Stock Exchange (PSX) enforces strict daily price limits called Circuit Breakers (+7.5% upper limit and -7.5% lower limit). Furthermore, once you place a Stop-Loss order at a PSX broker, your shares become "locked" by that order.
Our bot uses a Hybrid Risk Model: it places a physical Stop-Loss order on the broker's exchange servers for offline protection, while our intelligent software monitors for gap-downs and automatically releases locked shares before taking your profits.
Stop-Loss & Take-Profit Lifecycle Diagram
Real-World Example: Trading 500 Shares of TPLP
Here is a concrete timeline of how the bot handles a trade on Taseer Properties (TPLP) from initial entry to exit:
| Time / Event | What Happens in PSX Market | What the Bot Does Automatically |
|---|---|---|
| 10:00 AM — BUY Signal | TradingView sends BUY signal for TPLP at 15.00 PKR. | Calculates affordability, places BUY order for 500 shares. |
| 10:00:02 AM — Broker Fills | Broker confirms 500 shares bought at 15.00 PKR. | ✅ Immediately sends Broker Stop-Loss (type: 4) at 14.50 PKR and stores active_stop_order_id. |
| Scenario A — Take-Profit Hit | TPLP rises to 15.80 PKR. TradingView sends SELL signal. | 2-Step Auto Sequence: 1. Cancels active Stop-Loss order at broker so shares unlock. 2. Instantly executes SELL order at 15.80 PKR to lock in profit. |
| Scenario B — Stop-Loss Hit | TPLP drops to 14.50 PKR without TradingView signal. | Broker automatically sells 500 shares at 14.50. Bot receives webhook, updates trade to CLOSED (BROKER_STOP_LOSS), and calculates fees. |