OpenAlgoPlugin
OpenAlgo Amibroker Plugin
Install / Use
/learn @marketcalls/OpenAlgoPluginREADME
OpenAlgo AmiBroker Data Plugin
Version 1.0.0 | Real-time and Historical Market Data for Indian Brokers
An advanced AmiBroker data plugin that seamlessly connects with OpenAlgo-supported Indian brokers, providing real-time streaming quotes and historical market data with intelligent caching and robust error handling.
⚠️ IMPORTANT DISCLAIMER
EDUCATIONAL PURPOSE ONLY - NOT FOR LIVE TRADING
This plugin is provided FOR EDUCATIONAL AND RESEARCH PURPOSES ONLY. It is NOT intended, designed, or suitable for live trading or making real-time trading decisions.
Data Source and Quality
- Data Source: All market data is sourced directly from brokers connected through the OpenAlgo platform
- No Data Guarantee: OpenAlgo, its maintainers, contributors, and team members make NO WARRANTIES OR GUARANTEES regarding:
- Accuracy of market data
- Completeness of market data
- Timeliness of data delivery
- Data integrity or reliability
- Continuity of data service
Liability Disclaimer
- No Liability: OpenAlgo, its maintainers, developers, contributors, and team are NOT LIABLE for:
- Any trading losses or financial damages
- Data errors, delays, or omissions
- System failures or interruptions
- Any decisions made based on this data
- Consequences of using this plugin for trading
Usage Restrictions
- ✅ Permitted Use: Education, learning, backtesting, research, analysis
- ❌ Not Permitted: Live trading decisions, automated trading systems, real-money trading
Your Responsibility
- Verify All Data: Always verify data accuracy from official broker sources before any trading decision
- Use at Your Own Risk: You assume full responsibility for any use of this plugin
- No Trading Advice: This plugin does not provide trading advice or recommendations
- Consult Professionals: Consult with licensed financial advisors before trading
BY USING THIS PLUGIN, YOU ACKNOWLEDGE AND ACCEPT THESE TERMS.
Overview
The OpenAlgo AmiBroker Plugin bridges AmiBroker with the OpenAlgo platform, enabling traders to access live market data from multiple Indian brokers through a unified API. Built with performance and reliability in mind, it supports both WebSocket-based real-time streaming and HTTP API for historical data retrieval.
Key Features
Data Capabilities
- Real-time Quote Streaming: WebSocket-based live market data with sub-second latency
- Historical Data Backfill: Intelligent data retrieval with automatic gap filling
- Mixed EOD/Intraday Support: Seamlessly combines daily and 1-minute data
- Multiple Exchanges: NSE, BSE, MCX, NFO, and other Indian exchanges
- Intraday & EOD Data: Full support for 1-minute and daily intervals
Performance & Reliability
- Intelligent Caching: 5-second TTL quote cache for optimal performance
- Auto-Reconnection: Robust connection management with retry logic
- Duplicate Prevention: Smart timestamp matching prevents data duplication
- Sorted Data: Automatic chronological sorting for correct chart display
- Timestamp Normalization: Fixes "freak candle" issues during live updates
User Experience
- Simple Configuration: Easy-to-use dialog with connection testing
- Visual Status Indicators: LED color-coded connection status
- WebSocket Testing: Built-in connection and subscription testing
- Clean Status Messages: User-friendly success/failure indicators
Recent Improvements (v1.0.0)
Critical Bug Fixes
-
Freak Candles Fix (2025-01-23)
- Normalized seconds/milliseconds for 1-minute bars
- Prevents duplicate bars from appearing during live updates
- Location:
Plugin.cpp:708-717
-
Timestamp Sorting Fix (2025-01-23)
- Added automatic sorting after data merge
- Ensures proper chronological order
- Fixes mixed-up timestamps in Quote Editor
- Location:
Plugin.cpp:880-886
-
WebSocket Status Simplification (2025-01-23)
- Removed problematic Unicode characters
- Clean "successful" or "failed" messages
- No more garbled text in status display
- Location:
OpenAlgoConfigDlg.cpp:503-541
System Requirements
Software Requirements
- AmiBroker: Version 6.0 or higher (64-bit recommended)
- Windows: 7/8/10/11 (64-bit)
- OpenAlgo Server: Latest version installed and running
- .NET Framework: 4.7.2 or higher
- Visual C++ Redistributable: 2019 or later
Network Requirements
- Active internet connection
- Firewall access for HTTP/HTTPS (port 5000 or custom)
- Firewall access for WebSocket (ws:// or wss://)
Broker Requirements
- Active account with OpenAlgo-supported broker
- Valid API credentials from OpenAlgo platform
Installation
Step 1: Download Plugin
Download the latest OpenAlgo.dll from:
- GitHub Releases: OpenAlgo Plugin Releases
- OpenAlgo Website: https://openalgo.in
Step 2: Install Plugin
- Locate your AmiBroker installation directory (typically
C:\Program Files\AmiBroker) - Navigate to the
Pluginssubdirectory - Copy
OpenAlgo.dllto thePluginsfolder - Restart AmiBroker
Step 3: Configure Database
- Open AmiBroker
- Go to File → Database Settings
- Click Configure next to the data source dropdown
- Select OpenAlgo Data Plugin
- Enter your configuration details:
- Server: Your OpenAlgo server URL (e.g.,
127.0.0.1or domain) - Port: API port (default:
5000) - API Key: Your OpenAlgo API key
- WebSocket URL: WebSocket endpoint (e.g.,
ws://127.0.0.1:8765) - Refresh Interval: Data refresh rate in seconds (default:
5) - Time Shift: Timezone adjustment in hours (default:
0)
- Server: Your OpenAlgo server URL (e.g.,
Step 4: Test Connection
- Click Test Connection button to verify HTTP API connectivity
- Click Test WebSocket button to verify WebSocket connectivity
- Both tests should show "successful" status
- Click OK to save settings
Step 5: Create Database
- In AmiBroker, go to File → New → Database
- Enter database name (e.g., "OpenAlgo Data")
- Select OpenAlgo Data Plugin as data source
- Click Create
Configuration Reference
Server Settings
| Setting | Description | Example | Default |
|---------|-------------|---------|---------|
| Server | OpenAlgo server hostname or IP | 127.0.0.1, api.example.com | - |
| Port | HTTP API port number | 5000 | 5000 |
| API Key | Authentication key from OpenAlgo | your-api-key-here | - |
| WebSocket URL | Full WebSocket URL including protocol | ws://127.0.0.1:8765 | - |
Advanced Settings
| Setting | Description | Range | Default | |---------|-------------|-------|---------| | Refresh Interval | How often to check for new data (seconds) | 1-3600 | 5 | | Time Shift | Timezone adjustment (hours) | -48 to +48 | 0 |
Supported Brokers
The plugin supports all brokers integrated with OpenAlgo, including but not limited to:
Major Brokers
- Zerodha (Kite API)
- Angel One (Angel One API)
- Upstox (Upstox API)
- Dhan (Dhan HQ API)
- Fyers (Fyers API v3)
Additional Brokers
- 5Paisa
- AliceBlue
- Finvasia (Shoonya)
- Flattrade
- IIFL
- Kotak Securities
- Mastertrust
- Motilal Oswal
- And more...
Note: Check the OpenAlgo documentation for the complete list of supported brokers.
Supported Data Types
Intervals
- 1-minute (
1m): Intraday data for the last 30 days - Daily (
D): End-of-day data for up to 1 year
Markets
- Equity: NSE, BSE stocks
- Derivatives: NSE F&O (Futures & Options)
- Commodities: MCX commodities
- Currency: Currency futures
- Indices: NIFTY, BANKNIFTY, etc.
Data Fields
- Open, High, Low, Close (OHLC)
- Volume
- Open Interest (for F&O)
- Timestamp (Unix epoch)
Usage Guide
Adding Symbols
Method 1: Via Symbol Dialog
- Right-click in the Symbol Tree
- Select New Symbol
- Enter symbol name in format:
SYMBOL-EXCHANGE- Example:
RELIANCE-NSE,NIFTY50-NSE,CRUDEOIL-MCX
- Example:
Method 2: Via Quick Search
- Press
Ctrl+K(Quick Search) - Type symbol name
- If not found, AmiBroker will create it automatically
Symbol Naming Convention
Use the format: SYMBOL-EXCHANGE
Examples:
- Equity:
TCS-NSE,INFY-NSE - Futures:
NIFTY25JANFUT-NFO,BANKNIFTY25JANFUT-NFO - Options:
NIFTY2552524000CE-NFO - Commodities:
CRUDEOIL25JANFUT-MCX,GOLD25FEBFUT-MCX
Viewing Charts
- Select a symbol from the Symbol Tree
- Chart will auto-load with historical data
- Right-click on chart → Parameters to change interval
- Available intervals: 1-minute, Daily
- AmiBroker will compress 1-minute data for 5m, 15m, 60m views
Real-time Updates
- Real-time data streams automatically via WebSocket
- Quote window shows live LTP (Last Traded Price)
- Charts update based on Refresh Interval setting
- Status LED (bottom-right) indicates connection status:
- Green: Connected and receiving data
- Yellow: Waiting to connect
- Red: Disconnected, will retry
- Purple: Manual reconnection required
Troubleshooting
Connection Issues
Problem: "Connection failed" error
Solutions:
- Verify OpenAlgo server is running
- Check server URL and port are correct
- Ensure firewall allows connections
- Test with
http://127.0.0.1:5000/api/v1/pingin browser
Problem: "Authentication rejected" error
Solutions:
- Verify API key is correct (copy from OpenAlgo settings)
- Ensure no extra spaces in API key
- Check API key is active in OpenAlgo
Data Issues
Problem: No historical data loading
Solutions:
- Check symbol format (must be
SYMBOL-EXCHANGE) - Verify broker supports the symbol
- Check market hours (some data only available during market)
- Use correct exchan
