DhelmGfeed

DhelmGfeed

new DhelmGfeed(params)

Source:
Parameters:
Name Type Description
params Object
Name Type Description
ws_url string

The web socket url(required).

api_key string

The api key you have got on subscription(required).

auto_reconnect boolean

If false not autoreconnection attempt will be made(optional).

multiplier int

Multliper to increase the duration of delay for responses with longer length(optional).

synchronization_delay int

The delay required to receive response for a request(optional).

function_release_time int

The systematic delay between subsequent calls to a function(optional).

Methods

(static) setAutoReconnectStatus(isTrue)

Set auto reconnection status.

Source:
Parameters:
Name Type Description
isTrue boolean

Auto reconnection status will be true if set true, else false.

(static) setFunctionReleaseTime(value)

Set function release time.

Source:
Parameters:
Name Type Description
value number

function release value.

(static) setMultiplier(value)

Set multiplier value to increase delay.

Source:
Parameters:
Name Type Description
value number

multiplier Multiplier value.

(static) setSynchronizationDelay(value)

Set synchronization delay.

Source:
Parameters:
Name Type Description
value number

delay value.

connect()

Initiate a websocket connection

Source:

connected() → {bool}

Check if the web socket is connected

Source:
Returns:
Type:
bool

disconnect(force_disconnect)

Disconnects the web socket connection

Source:
Parameters:
Name Type Description
force_disconnect boolean

User promted disconnect

getExchangeMessage(param, callback)

Get exchange message for the given exchange

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange.

callback function

The callback function

getExchanges(callback)

Get the list of subscribed exchanges

Source:
Parameters:
Name Type Description
callback function

The callback function

getExpiryDates(param, callback)

Get the list of expiry dates for different products for the given exchange

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange.

instrument_type string

The type of the instrument, e.g. OPTIDX,FUTIDX etc(optional).

product string

The product, e.g. NIFTY,BANKNIFTY etc(optional).

callback function

The callback function

getHistoricalOHLC(param, callback)

Returns array with historical data (array of OHLC)

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange(required).

instrument_identifier string

The instrument identifier(required).

periodicity number

"HOUR"."MINUTE"."DAY","WEEK", or "MONTH"(required).

from number

The from time in unix timestamp(required).

to number

The to time in unix timestamp(required).

max number

Numerical value of maximum records that should be returned. Default = 0 (means all available data).(optional).

callback function

The callback function

getHistoricalTick(param, callback)

Returns array with historical data (array of Ticks)

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange(required).

instrument_identifier string

The instrument identifier(required).

from number

The from time in unix timestamp(required).

to number

The to time in unix timestamp(required).

max number

Numerical value of maximum records that should be returned. Default = 0 (means all available data).(optional).

callback function

The callback function

getInstruments(param, callback)

Returns array of instruments (properties) by selected exchange.

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange(required).

instrument_type string

Name of Supported InstrumentType.E.g. FUTIDX(optional).

product string

Name of Supported Product..E.g. BANKNIFTY(optional).

expiry string

Value of Supported Expiry..E.g. 30AUG2018(optional).

optiontype string

Name of the option type..E.g. CE(optional).

strikeprice string

String representation of the strike price.(optional).

callback function

The callback function

getInstrumentsOnSearch(param, callback)

Returns array of max. 20 instruments (properties) by selected exchange and ‘search word’

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange(required).

search_word string

The search word(required).

callback function

The callback function

getInstrumentTypes(param, callback)

Get the list of instrument types for the given exchange

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange.

callback function

The callback function

getLastQuote(param, callback)

Returns detailed information about Last Trade Price (LTP)

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange(required).

instrument_identifier string

The instrument identifier(required).

callback function

The callback function

getLastQuoteArray(param, callback)

Returns detailed information about Last Trade Price (LTP) of Multiple Symbols (max 25 in single call)

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange(required).

instrument_identifiers Array

The instrument identifiers(required).

callback function

The callback function

getLimitation(callback)

Get limitations of your subscription plan

Source:
Parameters:
Name Type Description
callback function

The callback function

getMarketMessage(param, callback)

Get market message for the given exchange

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange.

callback function

The callback function

getOptionTypes(param, callback)

Get the list of option types for the given exchange

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange.

instrument_type string

The type of the instrument, e.g. OPTIDX,FUTIDX etc(optional).

product string

The product, e.g. NIFTY,BANKNIFTY etc(optional).

expiry string

The expiry date, e.g. 25OCT2018(optional).

callback function

The callback function

getProducts(param, callback)

Get the list of products for the given exchange

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange.

instrument_type string

The type of the instrument, e.g. NIFTY,GAIL etc(optional).

callback function

The callback function

getServerInfo(callback)

Get server information

Source:
Parameters:
Name Type Description
callback function

The callback function

getSnapshot(param, callback)

Returns last snapshot of Multiple Symbols (max 25 instruments in single call)

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange(required).

instrument_identifiers Array

The instrument identifiers(required).

periodicity string

The periodicity/"HOUR" or "MINUTE"(optional).

period number

The period.E.g. 1,2,3 etc.(optional).

callback function

The callback function

getStrikePrices(param, callback)

Get the list of strike prices for the given exchange

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange.

instrument_type string

The type of the instrument, e.g. OPTIDX,FUTIDX etc(optional).

product string

The product, e.g. NIFTY,BANKNIFTY etc(optional).

expiry string

The expiry date, e.g. 25OCT2018(optional).

optiontype string

The option type, e.g. PE,CE(optional).

callback function

The callback function

subscribeRealTime(param, callback)

Subscribe to Realtime data, returns market data every tick.

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange(required).

instrument_identifier string

The instrument identifier(required).

unsubscribe boolean

The default is false.Pass true to unsubscribe(optional).

callback function

The callback function

subscribeRealTimeSnapshot(param, callback)

Subscribe to Realtime data, returns data at snapshot periodicity.

Source:
Parameters:
Name Type Description
param object
Name Type Description
exchange string

The exchange(required).

instrument_identifier string

The instrument identifier(required).

periodicity string

The peridocity.Valid value is either "MINUTE" or "HOUR"(required).

unsubscribe boolean

The default is false.Pass true to unsubscribe(optional).

callback function

The callback function