Class: DhanHQ::Resources::MarketFeed
- Defined in:
- lib/DhanHQ/resources/market_feed.rb
Overview
Resource client for fetching on-demand market data snapshots.
Constant Summary collapse
- API_TYPE =
Market feed requests hit the data API tier.
:data_api- HTTP_PATH =
Root path for market feed endpoints.
"/v2"
Instance Attribute Summary
Attributes inherited from BaseAPI
Instance Method Summary collapse
-
#ltp(params) ⇒ HashWithIndifferentAccess
POST /v2/marketfeed/ltp Returns the LTP (Last Traded Price) of up to 1000 instruments.
-
#ohlc(params) ⇒ HashWithIndifferentAccess
POST /v2/marketfeed/ohlc Returns open-high-low-close for up to 1000 instruments.
-
#quote(params) ⇒ HashWithIndifferentAccess
POST /v2/marketfeed/quote Returns market depth, OI, and other details for up to 1000 instruments.
Methods inherited from BaseAPI
#delete, #get, #initialize, #post, #put
Methods included from AttributeHelper
#camelize_keys, #inspect, #normalize_keys, #snake_case, #titleize_keys
Methods included from APIHelper
Constructor Details
This class inherits a constructor from DhanHQ::BaseAPI
Instance Method Details
#ltp(params) ⇒ HashWithIndifferentAccess
POST /v2/marketfeed/ltp Returns the LTP (Last Traded Price) of up to 1000 instruments.
22 23 24 |
# File 'lib/DhanHQ/resources/market_feed.rb', line 22 def ltp(params) post("/marketfeed/ltp", params: params) end |
#ohlc(params) ⇒ HashWithIndifferentAccess
POST /v2/marketfeed/ohlc Returns open-high-low-close for up to 1000 instruments.
32 33 34 |
# File 'lib/DhanHQ/resources/market_feed.rb', line 32 def ohlc(params) post("/marketfeed/ohlc", params: params) end |
#quote(params) ⇒ HashWithIndifferentAccess
POST /v2/marketfeed/quote Returns market depth, OI, and other details for up to 1000 instruments.
42 43 44 |
# File 'lib/DhanHQ/resources/market_feed.rb', line 42 def quote(params) quote_resource.post("/marketfeed/quote", params: params) end |