Custom Python Stock Trading Bot

Job ID: 40138012

Budget: ₹600 – ₹1,500 INR

I need a clean, well-documented Python codebase that can run fully automated equity trades. The core of the job is to translate my proprietary entry-and-exit rules into executable logic, wrap that logic with dynamic position-sizing (scaling in and out), and add a real-time risk layer that can flatten all positions instantly when preset limits are breached.

Scope
• Entry & Exit Engine – I will provide the exact signals separately; your task is to code them so they fire only during regular U.S. market hours and can be toggled on/off without changing the source.
• Scaling Logic – once in a trade, the position should grow or shrink in predefined increments based on live P&L and volatility.
• Kill Switch – a hard stop that cancels all open orders and closes all active positions if daily loss, connectivity, or slippage limits are hit.
• Position Tracker – persistent record of every order, fill, and modification, saved to both memory and an on-disk log for reconciliation.

Tech Notes
• Python 3.x with standard packages (pandas, numpy, asyncio) plus any broker API SDK you prefer for equities (e.g., Interactive Brokers, Alpaca).
• Code must be modular so the strategy logic sits in its own file; that way I can swap in new rules later without touching infrastructure.
• Unit tests for each critical function, especially risk checks and position tracking.

Acceptance Criteria
1. Strategy module triggers the correct orders in a sandbox environment.
2. Scaling executes without race conditions or duplicate orders.
3. Kill switch closes all exposure within two seconds of activation.
4. Position log matches broker fills 100 %.

Push everything to a private Git repo; I’ll test on my end with my own API keys and live market feed.
Related categories: Python API Development