Skip to content

Streaming

Streaming

class Feed(symbols, accid, userid, callBack, subscribe_order: bool = True, subscribe_quote: bool = True)

To subscribe to the streamer, Create the single instance of this mentioning callback method. After successful subscription, callback method will be called whenever packet is available at the streamer.

Parameter
symbols Symbol list for subscription : Symbol_exchange (exchangetoken) to be obtained from Contract File
accid Customer Account ID (Trading A/C No. available in My Profile section of Edelweiss.in OR get it from eqAccID of Get Login Info)
userid Your user name for Edelweiss.in
messageCallback Callback method to receive the Feed in
subscribe_order Subscribe to order True/False
subscribe_quote Subscribe to order True/False

Example -

EdelweissAPIConnect.Feed( ["226868_MCX"], 'XXXXXX', 'TESTUSER', getStreamingData, True, True )
def getStreamingData(message, feedObject):
    print('inside get streaming data')
    print(message)
{
   "response":{
      "data":{
         "a0":"14364.90",
         "a1":"14449.05",
         "a2":"14274.90",
         "a3":"14310.80",
         "a4":"14834.85",
         "a5":"14690.70",
         "a6":"13981.75",
         "a7":"0.00",
         "a8":"0.00",
         "a9":"14324.70",
         "b0":[
            {
               "z0":"0.00",
               "z1":"0",
               "z2":"0"
            }
         ],
         "b1":[
            {
               "z0":"0.00",
               "z1":"0",
               "z2":"0"
            }
         ],
         "b2":"0",
         "b3":"15431.75",
         "b4":"7511.10",
         "b5":"0.00",
         "b6":"13.90",
         "b7":"0.10",
         "b8":"-510.15",
         "b9":"-3.44",
         "c0":"-366.00",
         "c1":"-2.49",
         "c2":"342.95",
         "c3":"2.45",
         "c4":"--",
         "c5":"--",
         "c6":"0.00",
         "c7":"0",
         "c8":"0",
         "c9":"0",
         "d0":"0",
         "d1":"0",
         "d2":"0.00",
         "d3":"0.00",
         "d4":"0.00",
         "d5":"13 Apr 2021, 12:22:37 PM",
         "d6":"13 Apr 2021, 12:22:37 PM",
         "d7":"13 Apr 2021, 12:22:37 PM",
         "d8":"14984.15",
         "d9":"14248.70",
         "e0":"15336.30",
         "e1":"14248.70",
         "e2":"15431.75",
         "e3":"13596.75",
         "e4":"15431.75",
         "e5":"284.04",
         "e6":"-372.70",
         "e7":"-2.54",
         "e8":"-720.15",
         "e9":"-4.79",
         "f0":"-254.05",
         "f1":"-1.74",
         "f2":"2376.30",
         "f3":"19.91",
         "f4":"5316.95",
         "f5":"59.12",
         "g5":"0",
         "g6":"0",
         "z3":"-29"
      },
      "streaming_type":"quote3"
   }
}

Symbol Value
a0 OPEN
a1 HIGH
a2 LOW
a3 CLOSE
a4 WEEK CLOSE PROCE
a5 MONTH CLOSE PRICE
a6 YEAR CLOSE PRICE
a7 HIGH CIRCUIT LIMIT
a8 LOW CIRCUIT LIMIT
a9 LAST TRADED PRICE
b0 BID ARRAY
b1 ASK ARRAY
b2 TOTAL VOLUME
b3 YEAR HIGH
b4 YEAR LOW
b5 AVERAGE PRICE
b6 CHANGE
b7 CHANGE %
b8 WEEK CHANGE
b9 WEEK CHANGE %
c0 MONTH CHANGE
c1 MONTH CHANGE %
c2 YEAR CHANGE
c3 YEAR CHANGE %
c4 OI CHANGE
c5 OI CHANGE %
c6 TOTAL TRADED VOLUME
c7 MARKET STATUS (IF OPEN(1) OR CLOSE(2))
c8 TOTAL BUY QTY
c9 TOTAL SELL QTY
d0 LAST TRADED QUANTITY
d1 OPEN INTEREST
d2 SPOT PRICE
d3 FUTURE PRICE
d4 PREMIUM DISCOUNT
d5 LAST TRADED TIME
d6 ACTUAL LAST TRADED TIME
d7 LAST UPDATED TIME
d8 ONE WEEK HIGH
d9 ONE WEEK LOW
e0 ONE MONTH HIGH
e1 ONE MONTH LOW
e2 THREE MONTH HIGH
e3 THREE MONTH LOW
e4 ALL TIME HIGH
e5 ALL TIME LOW
e6 ONE WEEK ROLLING CHANGE
e7 ONE WEEK ROLLING CHANGE %
e8 ONE MONTH ROLLING CHANGE
e9 ONE MONTH ROLLING CHANGE %
f0 THREE MONTH ROLLING CHANGE
f1 THREE MONTH ROLLING CHANGE %
f2 SIX MONTH ROLLING CHANGE
f3 SIX MONTH ROLLING CHANGE %
f4 ONE YEAR ROLLING CHANGE
f5 ONE YEAR ROLLING CHANGE %
f6 BID IV FUTURE
f7 ASK IV FUTURE
f8 LTP IV FUTURE
f9 BID IV SPOT
g0 ASK IV SPOT
g1 LTP IV SPOT
g2 ROLLOVER COST
g3 ROLLOVER COST %
g4 ROLLOVER %
g5 IS NEWS AVAILABLE
g6 IS RESEARCH AVAILABLE
z0 ASK/BID PRICE
z1 ASK/BID QTY
z2 ASK/BID NUMBER
z3 SYMBOL

Unsubscribe

This method will unsubscribe the symbols from the streamer. After successful invocation of this, will stop the streamer packets of these symbols.
Use the Feed object received in the callback method to unsubscribe.

feedObject.unsubscribe(symbols)
symbols: streaming symbol for the scrips which need to be unsubscribed