Symbol Settings
Symbol Settings is the default tab in APIBridge. Also, It allows you to add rows of Symbols in which your strategy will trade.
- Symbol Setting -> Input Symbol: This should be the same as the symbol in your chart or other application such as Amibroker/MT4/Python/TradingView. Moreover, this field is mandatory.
2. Symbol Settings ->Exchange Symbol: Actual symbol for placing orders via API. Eg. NIFTY for Nifty index futures.
The Exchange Symbol field is optional. Although If your Input Symbol is the same as Exchange Symbol, you can keep it blank. Exchange symbol means the actual symbol used for trading. Example – BANKNIFTY for Banknifty futures.
3. Symbol Settings ->Instrument Name: Can select it from the drop-down. The Exchange value is taken automatically based on InstrumentName. InstrumentName field is mandatory. You can leave it blank if you want to dynamically provide it in Signal.
4. Symbol Settings ->Expiry, Strike, Type: Applicable and mandatory for derivatives only; leave blank for trading in Cash segment.
5. Symbol Settings ->Entry Order Type: Applicable for LE/SE signals. Chose from available options in drop-down.
This field is optional. If you want to dynamically sent the Entry Order Type in Signal, you can leave it blank.
6. Symbol Settings ->Exit Order Type: Applicable for LX/SX signals. Chose from available options in the drop-down.
This field is optional. If you want to dynamically sent Exit Order Type in Signal, you can leave it blank.
7. Symbol Settings ->Quantity: Fixed Qty: A fixed integer qty will be used for all LE/SE/LX/SX signals. Refer here for Qty by SL and Qty by Exposure.
Quantity Setting
The Fixed Qty field is optional. If you want to dynamically send Quantity in Signal, you can leave it blank.
Note: For NSE Derivatives, you need to provide absolute quantity, not a number of lots. Eg. provide 75 for placing orders in one lot of Nifty Futures. For MCX, you need to give quantity in a number of lots. Eg. provide 1 for trading in one lot of Crudeoil-mini. For MCX and Currency, we also request you to first place a test trade, since it may differ from broker to broker.
You can also use Qty by SL or Qty by Exposure.
8. Symbol Settings ->Product Type: Select from drag-drop.
Note that MIS is also referred to as Intraday or Margin by some brokers. NRML is referred to as Delivery or Day. Bracket Order (BO) may also be referred to as OCO; Cover Order (CO) may also be referred to as Protective Trade.
To find which product type is available, check your broker’s API documentation. You can also try placing an order manually through your broker’s web trading terminal.
9. Symbol Settings ->MaxOpenPosition: Maximum allowed position for Long or Short trades. Eg., if you provide 100, it will reject new LE/SE signals if they can increase NetPos by more than 100. It works for both Long and Short positions. This field is optional.
10. Symbol Settings ->MaxProfit/MaxLoss: It squares off the current position based on the Unrealized MTM received via API. Note that MaxProfit does not stop trading; if fresh signals are received, they will be processed. Unrealized MTM is also called Live PnL; i.e. the profit or loss from your open position. The PnL from your closed positions is not considered here. This field is optional.
Caveat :
(1) Max Open Position depends on the order status returned by Broker API. If the Broker API does not return order status correctly, the net position will not maintain properly, and Max Open Position will also not work.
(2) Max Profit and Max Loss depends on the Unrealized MTM returned by Broker API. If the Broker API responds with lag or latency, the Max Profit and Max Loss may not work properly.
Bypassing Symbol Settings – Only for Advanced Users.
You can bypass all Symbol Settings, and the signal rules will still work. This is recommended only for advanced users who understand complete process flow of APIBridge; and, have nicely coded strategies which send perfect Signal parameters to APIBridge. This has many important use cases. For example, you may want to trade in large number of option strikes which are calculated dynamically in your strategy – so you do not have to worry about adding all option strikes under Symbol Settings. Or, you may want to trade based on scan of large number of stocks and its inconvenience to add all stocks in Symbol Settings.
To bypass symbol settings, Go to APIBridge folder -> Templates – Advanced Template -> open settings.xml
Search for:
<OverrideSignalSettings></OverrideSignalSettings>
Replace with:
<OverrideSignalSettings>Y</OverrideSignalSettings>
IMPORTANT: If you do not send correct data in Signal, such as Symbol, Instrument, OrderType etc, orders will not be placed.
Which symbols can you trade in via APIBridge?
1. EQ: You can trade in all symbols of EQ
2. FUTSTK: As of now, only stocks of Nifty 50 are available for trading in this instrument.
3. FUTIDX: You can only trade in NIFTY and BANKNIFTY symbols in this instrument
4. OPTSTK: As of now, only stocks of Nifty 50 are available for trading in this instrument.
5. OPTIDX: You can only trade in NIFTY and BANKNIFTY symbols in this instrument
6. FUTCOM: You can trade in the following symbols- GOLD, GOLDM, GOLDGUINEA, SILVER, SILVERM, SILVERMIC, NATURALGAS, CRUDEOIL, LEAD, ALUMINIUM, ZINC, NICKEL, COPPER
7: FUTCUR: You can trade in these 4 currency pairs- USDINR, EURINR, JPYINR, GBPINR
Important: Please note that the above instruments and symbols will work only if your broker allows trading in these segments or only if the particular segment is enabled in your Broker Terminal.
The above-mentioned scrips are allowed only on volume measure. Scrips with lesser volume are not suitable for Algo trading as they can lead to high slippages due to wider spread, hence loss of money in Algo trading.
As the trade progresses, I want to move my stop loss to cost + some profit.
For example, if my cost is 100, I want to move my stop loss to 110 and let the trade run its course. Is this possible?
Its possible only through coding. You need to code SL in your strategy part. When SL is hit, strategy should trigger LX/SX which will be sent to trading by APIBridge.
I have still not been able to trade options through API Bridge. It always says symbol not found.
I have checked your videos and manuals and haven’t seen any of them give symbol settings for Index and Equity Options.
Would you please give me the symbol settings for BankNifty and Nifty here as an answer to this comment?
For example Amibroker symbol is NIFTY_8800PE-21MAY2020
What would be the exchange symbol for this? I am using Alice Blue.
I found the issue.
I tried sending symbol name , ” NIFTY10400CE” from trading view. But in bridge it didn’t took numeric part, it was read as “NIFTYCE”
Numeric part is not supported symbol name for api bridge
hi chartbridge working or not? whenever i’m trying it shows symbol settings not found for instrument….
kindly reply i can’t able to contact through phone…
How often does API Bridge check the Unrealized PNL of an open position, through the broker API?
It depends on rate limits imposed by Broker API. It can be anything from once in 0.5 second to once in 3 second.
Is it possible to Trade banknifty/nifty options through API bridge ? IF YES then where i can find symbol settings for it ?
See examples here http://mycoder.pro/apibridge/how-to-set-powerful-algo-alerts-in-tradingview/
I want to keep maximum SL per scip as Rs 500, In signal settings file, EXP is kept as 50000 but the column “Q” has value -5000. Do I need to change this column “Q” value from -5000 to -500 for the purpose. I tried to replace the value, saved the excel file but the same is not being reflected in API bridge symbol settings. I have tried restarting Api bridge launcher several times. What step i need to take?
For symbols import – the easiest thing is (1) Delete all rows in symbol settings (2) Add one or two row manually with all correct settings (3) Export to understand fromat (3) Add more symbols in same format and import back. Details here http://mycoder.pro/apibridge/how-to-import-export-symbol-settings/
max profit and loss values are multiple of scripts quantity or directly amount number. i.e if there are 1000 shares and i want to square of with 2 rupees profit . Should i enter number 2 or 2000 in max profit / loss section
you have to enter unrealized mtm – 2000 in this case
Sir , MAX LOSS and MAX PROFIT is not working properly. It sends signal but in reverse direction.
To square off a postion of -100 shares it sends signal to buy -100 shares not +100 shares.
What to do ?
And also sometimes to squareoff a position it sends signal of value 0 shares whether it is in buy or sell.
Resolve my query.
Wow that was odd. I just wrote an very lⲟng comment but after I clicked submit my comment didn’t show up.
Grrrr… well I’m not writing all that over again. Anywɑys, just wаnted to say excellent blog!
I tried to add banknifty options in but i did not find the symbol for that. in help only nifty call is mentioned. i am using tradingview.
Can any one suggest SYMBOL in trading view and Input symbol in fyers API for banknifty options.