Google Spreadsheets
Quick Start Guide

Step 1: Clone the Template Spreadsheet
Open the OpenAlgo Trading Template
Click "File" > "Make a copy" to create a duplicate of the spreadsheet.
In the "Make a copy" dialog, enter a name for your copy of the spreadsheet, such as "My OpenAlgo Trading Sheet".
Ensure the "Folder" is set to your desired location, such as "My Drive".
Click the "Make a copy" button to create the new spreadsheet.

Step 2: Configure API Settings
Open the cloned spreadsheet
Go to Extensions > Apps Script
Locate these lines in the script:
5. Replace with your OpenAlgo credentials:
apikey: Your unique OpenAlgo API key, generated on the API Key page of the OpenAlgo dashboard. This is not your broker's API key.hostServer: The URL where OpenAlgo is reachable from Google's servers. Apps Script runs in Google's cloud, sohttp://127.0.0.1:5000will never work. Use a custom domain, or a tunnel such as ngrok, Cloudflare Tunnel or a VS Code Dev Tunnel. Do not leave a trailing slash.
Spreadsheet Structure
The template contains two main sheets:
PlaceOrder: For entering trade details
Logs: Automatic logging of trade orders
PlaceOrder Sheet Columns
C3
Exchange
NSE, NFO, CDS, BSE, BFO, BCD, MCX, NCDEX, NCO, NSE_INDEX, BSE_INDEX
D3
OpenAlgo Symbol
INFY, RELIANCE
E3
Action
BUY/SELL
F3
Price Type
MARKET/LIMIT/SL/SL-M
G3
Total Quantity
100
H3
Price
1500.50 (used by LIMIT and SL, send 0 otherwise)
I3
Trigger Price
1480.00 (used by SL and SL-M, send 0 otherwise)
J3
Split Size
0 - No SplitOrder Specific Number - Send Split order with split size quantity
K3
Product Type
MIS (intraday), NRML (carry forward), CNC (delivery)
The values in C3, E3, F3 and K3 are sent to the OpenAlgo API exactly as typed, so they must match the API's own vocabulary. product accepts only MIS, NRML and CNC. Words such as INTRADAY or DELIVERY are rejected by the API with a validation error.
Split Order Functionality
Split Size 0: Entire quantity in one order. The script sends the total quantity as the split size, so the API produces exactly one order.
Split Size > 0: Multiple orders of the specified size, plus one final order for the remainder if the total does not divide evenly.
A split order may produce at most 100 child orders. Beyond that the API rejects the request.
Child orders are placed sequentially, paced from
ORDER_RATE_LIMIT(10 per second by default), so 100 child orders take roughly 10 seconds.
Execution
Fill in trade details in the PlaceOrder sheet
Press the PlaceOrder function
Check response in cell C9
View detailed logs in the Logs sheet
Troubleshooting
Common Issues
API Key Invalid
Verify key in OpenAlgo dashboard
Check network connectivity
Ensure API key has trading permissions
Host URL Incorrect
Confirm exact URL from OpenAlgo platform
Check for any trailing slashes
Verify ngrok or custom endpoint
Permissions
Accept Google Sheets script permissions
Verify API key authorization
Security Notes
Keep API key confidential
Use secure, unique API keys
Regularly rotate credentials
Monitor trading activities
Last updated