AlgoJi APIBridge documentation contains setup instructions and sample code with explanation. We have primarily used Amibroker in setup example; however, for Excel, Python or MT4 integration, contact us through email. Table of Content
- Supported Brokers: Zerodha, Upstox, Nirmal Bang, Interactive Brokers, IIFL, 5paisa, GRD, CompositeEdge, AliceBlue. For details see https://algoji.com/selecting-broker-algo-trading/
- Integration with Amibroker, Excel, Python, MT4 etc
- Allows trading for Multi-Strategies in Multi-Timeframe and Multi-Markets in Multi-Client Account Allows Multi-Order Types: L, M, SL-L, SL-M, BO, CO etc.
- Send custom order quantity for each trade based on your risk management rules
- Automatically select Multi-Strikes through your code for options trading
- Automatically select multi-expiry contracts through your code for options trading
- Trade using charts or without charts through scanner
- Does not needs VPS, reconnects to internet after internet interruption
- Custom Target, SL, time-based signals etc. for your code
- Maintain independent cycle of Long Entry, Long Exit, Short Entry and Short Exit signals.
Limitless possibilities with custom development…
APIBridge Demonstration with Live Trades
APIBridge Download, Installation and Setup
All AlgoJi customers have dedicated phone/email support for APIBridge.
APIBridge Integration Guide
For Amibroker, use the Amibroker Autotrade AFL Toolkit for set of pre-built code snippets.
• ID (mandatory): unique id for each signal sent via Amibroker. If two signals have the same id, the status for the respective order placed may be wrong.
• Type (mandatory): can be either LE, LX, SE or SX. LE: Long Entry, LX: Long Exit, SE: Short Entry, SX: Short Exit
• Symbol (mandatory): symbol name which will be matched to Input Symbol in API Bridge. If you want to send strike/expiry also through Amibroker, you can combine it in syntax “Symbol | Expiry | Strike | OptionType”
• OrderType (optional): can be L, M, SLL or SLM
• TrigPrice (optional): should be 0 or Null for market/limit orders. If you want to send extra parameters for OCO order, you can combine it in syntax “TrigPrice | StopLoss | SquareOff | TrailingTicks”
• Price (optional): should be 0 or Null for market orders
• Qty (optional): Order Quantity
• InstrumentName (mandatory): For upstox API, it should be any of the following EQ|FUTIDX|FUTSTK|OPTIDX|OPTSTK|FUTCOM
• StrategyTag (optional): It can be any string to identify which particular Amibroker strategy is sending the signals.
More on LE, LX, SE, SX:
- Exit signal is matched for initial Entry signal coming from the same strategy. If no Entry position was taken, the Exit signal is ignored. If, entry was taken for quantity Q, then exit order is also fired for same quantity Q. This is to prevent any code misfiring.
- For scale-in, scale-out strategies, you should fire signals with only LE and SE (do not use LX or SX). This is a simple way to avoid conditional checks applied by APIBridge.
Example 1: Send Market Order in Equities to create Short position:
Example 2: Send Stop Limit Order in Equities to create Short position:
Example 3: Send Stop Market Order in Equities to create Long position:
Example 4: Send OCO Order in Equities for Long trade:
Example 5: Send Limit Order in BankNifty Futures to create Short position:
Example 6: Send Limit Order in BankNifty Options to exit Long position:
Example 7: Send Market order in Currency Futures to exit Long position:
Testing & Debugging:
- Login to APIBridge. Login again to your upstox account.
- Go to Tools->Application Settings and verify all settings are correct.
- Go to Settings window in APIBridge and check that stock has been added with proper parameters.
- Go to Amibroker->Tools->Formula Editor. This will open new blank AFL file.
- Copy only the function call you want to test. Example: AlgojiBroadcastSignal(“5”, “LE”,”SBIN”,””,””,””,”1″,”EQ”,””,””,””,””,””);
- In AFL Editor, click Tools->Verify Syntax. This will execute function call and order will be placed.
Note that all Amibroker related issues are independent of APIBridge, or it’s plugin. These issues should be identified/resolved without integrating with APIBridge. Troubleshooting guide has been shifted to https://algoji.com/amibroker-auto-trading-problems/
You may also want to take the free amibroker course with afl templates, assignments and video tutorials https://algoji.com/guide-to-quantitative-investing-and-algorithmic-trading/