OpenAlgo is an Excel Add-In that provides seamless integration with the OpenAlgo API for algorithmic trading. This add-in allows users to fetch market data, place and manage orders, retrieve historical data, and interact with OpenAlgo's trading infrastructure directly from Excel.
- Account Management: Retrieve funds, order books, trade books, and position books.
- Market Data: Fetch real-time market quotes, depth, historical data, and available time intervals.
- Order Management: Place, modify, cancel, and retrieve order statuses.
- Smart & Basket Orders: Execute split, smart, and bulk orders.
- Risk Management: Close all open positions for a given strategy.
- .NET 8.0 SDK installed
- Excel-DNA Add-In (included in the project dependencies)
- Microsoft Excel (Office 365 recommended)
- Clone the repository or download the files.
- Open the project in Visual Studio.
- Build the project to generate the
.xll
add-in file. - Open Excel and load the add-in (
OpenAlgo-AddIn64.xll
). - Ensure Excel-DNA dependencies are installed.
To configure API credentials, use the following function:
=oa_api("YOUR_API_KEY", "v1", "http://127.0.0.1:5000")
This sets the API key, API version, and base URL for all further API requests.
Function | Description |
---|---|
=oa_funds() |
Retrieve available funds |
=oa_orderbook() |
Fetch open order book |
=oa_tradebook() |
Fetch trade book |
=oa_positionbook() |
Fetch position book |
=oa_holdings() |
Fetch holdings data |
Function | Description |
---|---|
=oa_quotes("SYMBOL", "EXCHANGE") |
Retrieve market quotes |
=oa_depth("SYMBOL", "EXCHANGE") |
Retrieve bid/ask depth |
=oa_history("SYMBOL", "EXCHANGE", "1m", "START_DATE", "END_DATE") |
Fetch historical data |
=oa_intervals() |
Retrieve available time intervals |
Function | Description |
---|---|
=oa_placeorder("Strategy", "SYMBOL", "BUY/SELL", "EXCHANGE", "LIMIT", "MIS", "10", "100", "0", "0") |
Place an order |
=oa_placesmartorder("Strategy", "SYMBOL", "BUY/SELL", "EXCHANGE", "LIMIT", "MIS", "10", "100", "0", "0", "0") |
Place a smart order |
=oa_basketorder("Strategy", A1:A10) |
Place multiple orders in a basket |
=oa_splitorder("Strategy", "SYMBOL", "BUY/SELL", "EXCHANGE", "100", "10", "LIMIT", "MIS", "100", "0", "0") |
Place split order |
=oa_modifyorder("Strategy", "241700000023457", "RELIANCE", "BUY", "NSE", 1, "LIMIT", "MIS", 2500, 0, 0) |
Modify an order |
=oa_cancelorder("Strategy", "241700000023457") |
Cancel a specific order |
=oa_cancelallorder("Strategy") |
Cancel all orders for a strategy |
=oa_closeposition("Strategy") |
Close all open positions for a strategy |
=oa_orderstatus("MyStrategy", "241700000023457") |
Retrieve order status |
=oa_openposition("Strategy", "SYMBOL", "EXCHANGE", "MIS") |
Fetch open positions |
- Most functions return structured tabular data directly into Excel.
- If an error occurs, the function returns a descriptive error message.
- Market data timestamps are converted to IST (Indian Standard Time) for better readability.
- If functions return
#VALUE!
, check if API credentials are set correctly using=oa_api()
. - Ensure the OpenAlgo backend is running and accessible at the configured
Host URL
. - Logs for failed API calls can be checked in the response messages returned to Excel.
- Ensure all parameter values are passed as strings to match OpenAlgo API specifications.
- By default, missing parameters in order functions are set to
"0"
or reasonable defaults.
- Issues: If you find any issues, report them in the repository's issue tracker.
- Contributions: PRs are welcome to improve features, documentation, or bug fixes.
- License: OpenAlgo is open-source and distributed under the AGPL-3.0 License.
The creators of this add-in are not responsible for any issues, losses, or damages that may arise from its use. It is strongly recommended to test all functionalities in OpenAlgo Analyzer Mode before applying them to live trading. Always verify API responses and exercise caution while executing trades.
🚀 Happy Trading!