What is OpenAlgo?
OpenAlgo is an open-source bridge that connects your trading strategies — written in Pine Script, Python, or any language — directly to your broker's API. It eliminates the need for manual order placement and lets your algorithms trade automatically.
Key benefits:
- Supports 15+ Indian brokers (Zerodha, Fyers, AngelOne, Upstox, and more)
- Runs locally on your machine — your credentials never leave your system
- Works with TradingView webhooks, Python scripts, and Excel
- Free and open source
Prerequisites
Before you begin, you'll need:
- A broker account with API access enabled
- Python 3.10+ installed on your machine
- Basic familiarity with the command line
Installation
Clone the OpenAlgo repository and install dependencies:
bashgit clone https://github.com/marketcalls/openalgo cd openalgo pip install -r requirements.txt
Copy the sample config file and edit it with your broker credentials:
bashcp .env.sample .env
Connecting Your Broker
Open .env in a text editor and fill in your broker API key and secret:
BROKER=zerodha
API_KEY=your_api_key_here
API_SECRET=your_api_secret_here
Each broker has slightly different fields — check the OpenAlgo documentation for your specific broker's requirements.
Starting the Server
Run the OpenAlgo server:
bashpython app.py
The server starts on http://localhost:5000 by default. Open your browser and complete the broker login flow.
Sending Your First Order
Once authenticated, you can place orders via the REST API:
pythonimport requests order = { "symbol": "RELIANCE", "exchange": "NSE", "action": "BUY", "quantity": 1, "price_type": "MARKET", "product": "MIS" } response = requests.post("http://localhost:5000/api/v1/placeorder", json=order) print(response.json())
A successful response will include an orderid confirming the order was placed.
Next Steps
- Connect TradingView alerts to OpenAlgo using webhooks
- Build a Pine Script strategy that fires alerts on your entries
- Set up position sizing and risk management rules
Start with paper trading or very small quantities until you've verified your strategy fires correctly. Always test your setup during market hours with a single unit first.
This is a sample post. Edit or delete it from the admin panel and start writing your own content.
Be the first to comment