GetLastQuote

GetLastQuote : Returns LastTradePrice of Single Symbol (detailed)

Supported parameters
Exchange String value like MCX Name of supported exchange. How to get list of supported exchanges you can find here
InstrumentIdentifier Value of instrument identifier How to get list of available instruments and identifiers you can find here
isShortIdentifier [true]/[false], default = [false] Optional parameter. By default function will use long instrument identifier format. Functions will use short instrument identifier format if set as [true]. Example of ShortIdentifiers are NIFTY25MAR21FUT, RELIANCE25MAR21FUT, NIFTY25MAR2115000CE, etc.
What is returned ?
Exchange, InstrumentIdentifier (Symbol), LastTradeTime, ServerTime, AverageTradedPrice (VWAP), Close (previous Day’s Close), Open, High, Low, LastTradePrice, LastTradeQty, TotalQtyTraded, BuyPrice (Bid), BuyQty (Bid Size), SellPrice (Ask), SellQty (Sell Size), OpenInterest, QuotationLot (Lot Size), Value (Turnover), PreOpen (if PreOpen), PriceChange (Change in Price compared to previous trading day’s Close), PriceChangePercentage (Percentage Change in Price compared to previous trading day’s Close), OpenInterestChange (Change in Open Interest compared to previous trading day’s Close)
LastTradeTime, ServerTime : These values are expressed as no. of seconds since Epoch time (i.e. 1st January 1970). Also known as Unix Time. Please Visit https://www.epochconverter.com/ to get formulae to convert human readable time to Epoch and vice versa (scroll to end of their home page)
Sample request(JavaScript)
{
MessageType: "GetLastQuote",
Exchange: "MCX",
InstrumentIdentifier: "CRUDEOIL-I",
};
var message = JSON.stringify(request);
websocket.send(message);
Example of returned data in JSON format
{
"AverageTradedPrice": 3029.07,
"BuyPrice": 3060,
"ButQty": 5,
"Close": 3043,
"Exchange": "MCX",
"High": 3073,
"InstrumentIdentifier": "CRUDEOIL-I",
"LastTradePrice": 3064,
"LastTradeQty": 0,
"LastTradeTime": 1594144795000,
"Low": 2994,
"Open": 3022,
"OpenInterest": 1845,
"PreOpen": false,
"QuotationLot": 1,
"SellPrice": 3064,
"SellQty": 7,
"ServerTime": 1594144800000,
"TotalQtyTraded": 100608,
"Value": 30474863700,
"PriceChange": 1,
"PriceChangePercentage": 0.03,
"OpenInterestChange": 0,
"MessageType":"LastQuoteResult"
}
×

Was this helpful?