Select Page

Signals are of 4 types: Long Entry (LE), Long Exit (LX), Short Entry (SE), Short Exit (SX).

Easiest – Zero Programming Effort

  1. Google Chrome Extension to fetch & process alerts with free TradingView Subscription
  2. Webhooks which work with TradingView and other platforms
  3. Excel: Only simple formula sufficient to setup strategies.

Intermediate – Coding in Scripts

  1. Amibroker: AFL codes for adding to strategy, dll plugin files
  2. MT4: Mq4, ex4 and mqh files
  3. NinjaTrader: ninjascript files
  4. Excel: VBA Macros

Advanced – Programming

Python/C#/Java: Programming the entire strategy and sending data to APIBridge

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. Advanced: you can also send signal to particular port in syntax “StategtTag | Port”. Example: “STG1|30002”

Do you want coding help to deploy your own strategy for live trading? Check our coding assistance.

Coding Examples

You can see below actual code samples in Amibroker, Connector and TradingView. All examples given below are sent using mostly blank columns in Bridge to place order.

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

AFL Code: AlgoJi_Signal("1", "SE","SBIN","Market|MIS","","","100","EQ","STG1");
Text File string: 1,SE,SBIN,Market|MIS,,,100,EQ,STG1
TradingView Alert: TYPE:SE:SYMBOL:SBIN:OT:Market|MIS:QTY:100:INS:EQ:STAG:STG1

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

AFL Code: AlgoJi_Signal("2", "SE","SBIN","SLL|MIS","302.50","302","100","EQ","STG1");
Text File string: 2,SE,SBIN,SLL|MIS,302.5,302,100,EQ,STG1
TradingView Alert: TYPE:SE:SYMBOL:SBIN:OT:SLL|MIS:TRIG:302.5:PRICE:302:QTY:100:INS:EQ:STAG:STG1

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

AFL Code: AlgoJi_Signal("8", "LE","SBIN","SLM|MIS","302","0","100","EQ","STG1");
Text File String: 8,LE,SBIN,SLM|MIS,302,0,100,EQ,STG1
TradingView Alert: TYPE:LE:SYMBOL:SBIN:OT:SLM|MIS:TRIG:302.5:PRICE:0:QTY:100:INS:EQ:STAG:STG1

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

AFL Code: Algoji_Signal("6", "LE","SBIN","Limit|CO","302|1.5","302.10","100","EQ","STG1");
Text File String: 6,LE,SBIN,Limit|CO,302|1.5,302.1,100,EQ,STG1
TradingView Alert: TYPE:LE:SYMBOL:SBIN:OT:Limit|CO:TRIG:302.5|1.5:PRICE:302.10:QTY:100:INS:EQ:STAG:STG1

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

AFL Code: Algoji_Signal("7", "LE","SBIN","SLL|BO","302|1.5|3","302.10","100","EQ","STG1");
Text File String: 7,LE,SBIN,SLL|BO,302|1.5|3,302.10,100,EQ,STG1
TradingView Alert: TYPE:LE:SYMBOL:SBIN:OT:SLL|BO:TRIG:302|1.5|3:PRICE:302.10:QTY:100:INS:EQ:STAG:STG1

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

AFL Code: Algoji_Signal("6", "SE","BANKNIFTY","Limit|NRML","","28400","20","FUTIDX","STG1");
Text File String: 6,SE,BANKNIFTY,SLM|MIS,,28400,20,FUTIDX,STG1
TradingView Alert: TYPE:SE:SYMBOL:BANKNIFTY:OT:SLM|MIS:PRICE:28400:QTY:20:INS:FUTIDX:STAG:STG1

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

AFL Code: Algoji_Signal("6", "LX","BANKNIFTY|28Nov2019|28400|CE","Limit|NRML","","102.50","20","OPTIDX","STG1");
Text File String: 6,LX,BANKNIFTY|28Nov2019|28400|CE,Limit|NRML,,102.5,20,OPTIDX,STG1
TradingView Alert: TYPE:LX:SYMBOL:BANKNIFTY|28Nov2019|28400|CE:OT:Limit|NRML:PRICE:102.5:QTY:20:INS:OPTIDX:STAG:STG1

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

AFL Code: Algoji_Signal("6", "LX","EURINR|27Nov2019","Market|NRML","","0","1000","FUTCUR","STG1");
Text File String: 6,LX,EURINR|26Nov2019,Market|NRML,,0,1000,FUTCUR,STG1
TradingView Alert: TYPE:LX:SYMBOL:EURINR|26Nov2019:OT:Market|NRML:PRICE:0:QTY:1000:INS:FUTCUR:STAG:STG1
AlgoJi APIBridge Documentation

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”. Values in Symbol Settings over-ride that given in Signal. For example, if qty in Symbol Setting is 100 and Signal received is 200, Bridge will place order with 100 qty only. If Qty is blank/null in Symbol Settings, the it will place the Qty from Signal (200 in this case).
  3. Signal Rules are applied from Application Settings -> Signal Rules
  4. Risk Management rules are applied.
  5. Order is sent to your Broker API

Do you want coding help to deploy your own strategy for live trading? Check our coding assistance.