Click or drag to resize

Fyers Connection

Fyers is a leading broker, based in India.

This section describes how to connect to the Fyers API.

Requirements

Please make sure you meet the below requirements to connect to Fyers.

Configuring Fyers Connection

Please follow the below steps to setup the Fyers Connection.

  • In the "Main View" goto Connection > Add Edit Connection
  • In the Add Edit connection view click on the Add button
  • In the "New Connection View" select 'Fyers' as the Connection Type and set the settings as
    • Append a suitable name of the connection in the Name textBox
    • Append a suitable master symbol download interval. If you append 0 (zero), then ArthaChitra will download the master symbol each time you connect to the API.
  • Click on the Close button and exit the Add Edit connection view

Now you will be able to connect to the newly created Fyers Connection from:

  • In Main View menu bar goto Connection > Available Connections > {name of the Fyers connection}
  • In the Fyers OAuth View append your Fyers login credentials
  • When logging for the first time you will be asked to provide required permission to our app "ArthaChitra""
Fyers Connection
Fyers Login Screen
Disclaimer

Before connecting to Fyers Connection please refer to the below scenarios for a proper understanding on how ArthaChitra works with the Fyers Connection. Please do note the below list is not exhaustive. There may be scenarios in addition to what listed below

  • The Fyers API has a throttling policy. Please click here to know more about it.
  • For FnO scrips ArthaChitra handles the order quantity in terms of number of contracts and NOT in lot size. For example if you are placing an order to buy 1 lot of Nifty futures then append the quantity as 1 (one) instead of 75 (seventy five) which is the current lot size. Similarly the FnO quantity is displayed in terms of number of contracts across the views.
  • The Fyers Connection downloads the master instruments which can be around 10MB in size. This can take some time depending on your net speed. The interval at which the same will be downloaded depends on the “Master download interval” connection settings.
  • The Fyers API does not supports OCO tags (for Cash and Margin ProductType). Thus if you submit any OCO order the OCO simulation will be evaluated locally. If you get disconnected the OCO orders will not canceled automatically.
  • Fyers API supports multiple order placement upto 10 (ten) orders simultaneously. In case you place more than 10 orders via the Basket Order View then ArthaChitra will slice the basket in batches of 10 orders.
  • Main View menu bar 'New > Orders > Cancel All Orders' will cancel all Cash and Margin orders. OCO/BO and CO orders will not be canceled.
  • Fyers connection supports OCO Order Template, Cover Order Templates and Multi-Level Bracket Order Templates. If you assign any order template while submitting an order please make sure to assign the Product Type as mentioned below:

    Order Template

    Product Type

    OCO Order Template (Bracket orders)

    OCO

    Cover Order Templates

    CO

    Multi-Level Bracket Order Templates

    Margin

  • Fyers OCO/BO orders does not supports Trailing stop orders
  • ArthaChitra does not supports spread orders or multi leg orders.
  • As of now the Fyers Connection does not supports automated strategies.
  • The Fyers API supports only Limit and Market orders for cover (CO) entry orders
  • Canceling the stop or target order of a bracket order (BO) or cover order (CO) will close the position.
  • Bracket orders (BO) and Cover orders (CO) are generated dynamically. As such the orders will be displayed in the views (Main View, Chart etc) only after ArthaChitra receives the order postback notification from the OMS.
  • In case the order status is not automatically updated, please refresh the order status by following the below steps
    • In Main View > Orders tab, select the necessary order
    • Right click on the selected order
    • In the context menu click on the option "Refresh order status"
  • The Holdings tab (in Main View) displays the actual holding values as returned by the Fyers API.
  • The Fyers API does not provides the trade or position updates via the sockets.
  • Fyers connection does not supports Reverse position commands
  • If you try closing a position it will use the API's Exit Position by Id request. Position will be cloes as per Instrument and product type (only Cash and Margin product types are supported).
  • You must first cancel working orders before pressing the Close postion command
  • If your logs return the below response then it denotes that the Fyers system/server is unavailable at that point of time. In such scenario please try sending your requests once the Fyers system/server is available for trading
    <html>
        <head><title>502 Bad Gateway</title></head>
        <body>
            <center><h1>502 Bad Gateway</h1></center>
        </body>
    </html>
See Also

Other Resources