Excel
Last updated
Last updated
OpenAlgo provides seamless integration with Excel for executing trading strategies, fetching market data, and managing orders. This documentation covers the available Excel functions, their usage, and examples.
Before installing OpenAlgo Excel Add-In, ensure you are selecting the correct version based on your Excel installation.
Open Microsoft Excel
Click File → Account
Click About Excel
Look for "32-bit" or "64-bit" in the version details.
If your Excel version is 64-bit → Install the 64-bit add-in ✅ (Recommended)
If your Excel version is 32-bit → Install the 32-bit add-in ✅
Download the OpenAlgo Excel Addin
OpenAlgo Excel Add-In is built using Excel-DNA, which requires the .NET 6 Desktop Runtime to run add-ins.
🔹 If the add-in is not working or Excel does not recognize it, install the .NET 6 Desktop Runtime from the link below:
➡ Download .NET 6 Desktop Runtime
✅ After installing the runtime, restart your system and try loading the add-in again.
Function: oa_api(api_key, [version], [host_url])
Example Usage:
=oa_api("your_api_key")
=oa_api("your_api_key", "v1", "http://127.0.0.1:5000")
Parameters:
api_key
(Mandatory): API Key for authentication
version
(Optional, default: "v1"): API version
host_url
(Optional, default: "http://127.0.0.1:5000"): API host URL
Function: oa_funds()
Example Usage:
=oa_funds()
Returns: A table with available funds and collateral details.
Function: oa_orderbook()
Example Usage:
=oa_orderbook()
Returns: A table with all open orders.
Function: oa_tradebook()
Example Usage:
=oa_tradebook()
Returns: A table with executed trades.
Function: oa_quotes(symbol, exchange)
Example Usage:
=oa_quotes("RELIANCE", "NSE")
Returns: Market price details for the given symbol.
Function: oa_depth(symbol, exchange)
Example Usage:
=oa_depth("RELIANCE", "NSE")
Returns: Order book depth for buy/sell levels.
Function: oa_history(symbol, exchange, interval, start_date, end_date)
Example Usage:
=oa_history("RELIANCE", "NSE", "1m", "2024-12-01", "2024-12-31")
Returns: Historical market data in a table format.
Function: oa_placeorder(strategy, symbol, action, exchange, pricetype, product, [quantity], [price], [trigger_price], [disclosed_quantity])
Example Usage:
=oa_placeorder("MyStrategy", "INFY", "BUY", "NSE", "LIMIT", "MIS", 10, 1500, 0, 0)
Parameters:
Mandatory: strategy
, symbol
, action
, exchange
, pricetype
, product
Optional: quantity
, price
, trigger_price
, disclosed_quantity
Function: oa_placesmartorder(strategy, symbol, action, exchange, pricetype, product, [quantity], [position_size], [price], [trigger_price], [disclosed_quantity])
Example Usage:
=oa_placesmartorder("SmartStrat", "INFY", "BUY", "NSE", "MARKET", "MIS", 10, "", 0, 0, 0)
Function: oa_modifyorder(orderid, strategy, symbol, action, exchange, [quantity], [pricetype], [product], [price], [trigger_price], [disclosed_quantity])
Example Usage:
=oa_modifyorder("Strategy", "241700000023457", "RELIANCE", "BUY", "NSE", 1, "LIMIT", "MIS", 2500, 0, 0)
Function: oa_cancelorder(orderid, strategy)
Example Usage:
=oa_cancelorder("Strategy", "241700000023457")
Function: oa_closeposition(strategy)
Example Usage:
=oa_closeposition("MyStrategy")
Function: oa_orderstatus(orderid, strategy)
Example Usage:
=oa_orderstatus("MyStrategy", "241700000023457")
Function: oa_openposition(strategy, symbol, exchange, product)
Example Usage:
=oa_openposition("MyStrategy", "INFY", "NSE", "MIS")
Test in OpenAlgo Analyzer Mode before using in live markets.
For more details, visit OpenAlgo Docs.