AlgoJi APIBridge Documentation

AlgoJi APIBridge allows you to algo trade with different platforms like Amibroker, MT4, TradingView, Python, Excel, NinjaTrader etc.

APIBridge Features

  1. Supported Brokers: Fyers, AliceBlue, Zebu, Goodwill, MasterTrust, SMC, Nirmal Bang, Interactive Brokers, IIFL, 5paisa, GRD, CompositeEdge. For details see https://algoji.com/selecting-broker-algo-trading/
  2. Acclaimed as India’s fastest Algo platform. See details here.
  3. 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.
  4. Send custom order quantity for each trade based on your risk management rules
  5. Automatically select Multi-Strikes through your code for options trading
  6. Automatically select multi-expiry contracts through your code for options trading
  7. Trade using charts or without charts through scanner
  8. Does not needs VPS, reconnects to internet after internet interruption
  9. Custom Target, SL, time-based signals etc. for your code
  10. Maintain independent cycle of Long Entry, Long Exit, Short Entry and Short Exit signals.

Limitless possibilities with custom development…

Download & Installation

Once you Subscribe, download and installation details will be sent to you over email.

Guides For  Amibroker, MT4, TradingView, Python etc. 

NOTE: APIBridge is same software which connects with any of the below platforms for algo trading.

TradingView Connection (English/ हिन्दी ):
https://algoji.com/tradingview-algo-trading/

Python Connection:
https://algoji.com/apibridge-python-sample-code/

Amibroker Connection :
https://algoji.com/faqs-amibroker-algo-trading/

MT4-MT5 Connection (English/ हिन्दी ):
https://algoji.com/metatrader-algo-trading/

Excel VBA Connection:
https://algoji.com/excel-vba-apibridge-integration/

NinjaTrader Connection:
https://algoji.com/ninjatrader-algo-setup/

List of Process Videos

See how to implement Multiclient/Dealer algo trading: https://www.youtube.com/watch?v=bkraFYVyqeA
See how to connect different brokers with amibroker/mt4/ninjatrader: https://www.youtube.com/watch?v=Go_ucdhRm_M
See here admin panel, and how to implement copy-trading: https://www.youtube.com/watch?v=izZBdNtSoQc
See order management rules https://www.youtube.com/watch?v=bkraFYVyqeA
See how to trade in watchlist of stocks https://youtu.be/-XtsgFl7Zlg
See how to trade in options https://youtu.be/dMg00wBDAcI
See how to implement martingale position sizing rules https://youtu.be/TkCVsY3GGlc
See how to import/export symbols in apibridge https://www.youtube.com/watch?v=z0MKg7YI6OY
Order Placement Troubleshooting: https://www.youtube.com/watch?v=Y0dYKIEDFh4
Setting up free Amazon AWS: https://www.youtube.com/watch?v=rSMM0iQfQjo

Understanding How APIBridge Work

The Bridge works based on “Signals”. A Signal is basically an indication (not decision) to Buy or Sell with specific conditions. The Bridge processes 4 types of Signals:

Long Entry (LE): Equivalent to fresh Buy for creating Long position

Long Exit (LX): Equivalent to Sell for reducing/squareoff Long position

Short Entry (SE): Equivalent to fresh Sell for creating Short position

Short Exit (SX): Equivalent to Buy for reducing/squareoff Short position

For placing orders, the Bridge requires values either from Signal, or from Symbol Settings window. Any values given in Symbol Settings window over-ride the Signal values.

As per above process diagram, the sequence of Signal processing is as follows:

  1. Signal is received in Bridge
  2. Values are taken from Symbol Settings window by matching symbol given in Signal with “Input Symbol”
  3. Signal Setting rules are applied from Application Settings -> Signal Settings
  4. Risk Management rules are applied from Application Settings -> Global Risk Management
  5. Order is sent to API

Integration Specific Files

Bridge connects with signal generation applications at three levels. Contact your Bridge Administrator (from where you purchased copy of this software) for these integration specific files.

Easiest – Zero Programming Effort

TradingView: An external app TVConnector to fetch & process alerts

Intermediate – Programming via Scripts

Amibroker: AFL codes for adding to strategy, dll plugin files

MT4: Mq4, ex4 and mqh files

NinjaTrader: ninjascript files

Advanced – Socket Programming

Python/C#/Excel VBA: Code for socket connection

Note: Multiple Targets, Partial exits, custom position sizing, scalping, multi-leg execution etc. may be available via Bridge. Contact your administrator for details.

Signal Format & Coding Guide

Bridge allows you to customize all values at each signal, such as quantity, or order type. You can program your own strategy to place orders with all custom values at each signal. For controlling order params via code, you should leave blank values in the Bridge under Symbol Settings. The mandatory values for each Symbol are marked with * under Symbol Settings.

The Signal format is:

ID,Type,Symbol,OrderType,TrigPrice,Price,Qty,InstrumentName,StrategyTag

  • ID (mandatory): should be unique id for each signal. If two signals are provided with same id, the application may misbehave.
  • Type (mandatory): can be either LE, LX, SE or SX.
  • Symbol (mandatory): symbol name which will be matched to Input Symbol underSymbol Settings. If you want to send strike/expiry also through Amibroker, you can combine it in syntax “Symbol | Expiry | Strike | OptionType”
  • OrderType (optional): can be Limit, Market, SLL or SLM. It can be combined for ProductType using “|”.
  • 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 (optional): It should be any of the following EQ|FUTIDX|FUTSTK|OPTIDX|OPTSTK|FUTCUR|FUTCOM
  • StrategyTag (optional): It can be any string to identify which particular strategy is sending Signals

Coding Examples

All example Signal codes given below are sent using mostly blank columns in Bridge to place order.

Example 1: Send Market Order in Equities to create Short position:

AlgoJi_Signal(“1”, “SE”,”SBIN”,”Market|MIS”,””,””,”100″,”EQ”,””);

Example 2: Send Stop Limit Order in Equities to create Short position:

AlgoJi_Signal(“1”, “SE”,”SBIN”,”SLL|MIS”,”302.50″,”302″,”100″,”EQ”,””);

Example 3: Send Stop Market Order in Equities to create Long position:

AlgoJi_Signal(“8”, “LE”,”SBIN”,”SLM|MIS”,”302″,”0″,”100″,”EQ”,”STG1″);

Example 4: Send Bracket Order in Equities for Long trade:

Algoji_Signal(“6”, “LE”,”SBIN”,”SLL|BO”,”302|1.5|3″,”302.10″,”100″,”EQ”,”STG1″);

Example 5: Send Limit Order in BankNifty Futures to create Short position:

Algoji_Signal(“6”, “LE”,”BANKNIFTY”,”Limit|NRML”,””,”28400″,”20″,”FUTIDX”,”STG1″);

Example 6: Send Limit Order in BankNifty Options to exit Long position:

Algoji_Signal(“6”, “LX”,”BANKNIFTY|28Nov2019|28400|CE”,”Limit|NRML”,””,”102.50″,”20″,”OPTIDX”,”STG1″);

Example 7: Send Market order in Currency Futures to exit Long position:

Algoji_Signal(“6”, “LX”,”EURINR|27Nov2019″,”Market|NRML”,””,”0″,”1000″,”FUTCUR”,”STG1″);