Get Candles and Indicators for a Security
Fetch candles and indicators for a particular security
Last updated
Fetch candles and indicators for a particular security
Last updated
This PUT endpoint enables you to retrieve candles and indicators for a particular security. This data includes price ranges, candles, and various other non-market data. It can de used to draw regular charts with various technical indicators.
There are four required parameters that must be provided in the request:
Authorization (header). This is the authorization token from the very first token request. The value of this header must have the following format: Bearer BQ898r9fefi
(Bearer
+ 1 space + the token).
API version (path). Unless necessary, leave it at "1.0".
model (body). This is a JSON dictionary that contains information about the enquired security.
Here's an example of the request body with the information about the enquired security.
where:
Securities
This is an array with the enquired securities.
Symbol
This is the ticker symbol of the security under which it is listed on the exchange.
Exchange (optional)
This is the exchange on which the enquired security is listed.
Currency (optional)
This is the currency in which the enquired security is denominated. Possible values: "USD".
Id
Signature
A configuration used to calculate an indicator. Find a list of available indicators below.
StartDate
EndDate
CandlesCount
This is the number of reference points for the chart. For example, if this parameter is set to 5, that chart will be drawn using five values.
Period
This is the preferred time frame for the chart. Possible values:
"1m";
"2m";
"3m";
"5m";
"10m";
"15m";
"30m";
"1h";
"2h";
"4h";
"1D";
"1W";
"1M";
"3M";
"6M";
"1Y".
Interval
This is the required time period for the specified time period. Possible values:
Candles = 0,
All = -1,
YearToDate = -2,
Custom = -3,
Day1 = -4,
Week1 = -5,
Month1 = -6,
Month3 = -7,
Month6 = -8,
Year1 = -9,
Year3 = -10,
CustomCandles = -11,
Day3 = -12,
Today = -13
Offset
This is the number of data points by which the technical indicator will be offset.
IndicatorsHistorySettings
This is a string that contains information about the required technical indicator. If the technical indicator is not necessary, set this parameter to []
.
Bollinger bands overlay
"Bollinger|1h|false|22|2|0"
Exponential moving average (EMA)
"EMA|1h|false|10|0"
Keltner Channels
"KeltnerChannels|1h|false|20|10|2|0"
Parabolic SAR
"SAR|1h|false|1|1"
Simple moving average (SMA)
"SMA|1h|false|10|0"
Volume-weighted average price (VWAP)
"VWAP|1h|false|10|2|0"
Average directional moving index (ADX)
"ADX|1h|false|10"
Average true range (ATR)
"ATR|1h|false|10"
Bollinger bands
"Bollinger|1h|false|22|2"
Chaikin Money Flow (CMF)
"CMF|1h|false|10"
Chaikin Volatility (CHV)
"CHV|1h|false|10"
Chande Momentum Oscillator (CMO)
"CMO|1h|false|10"
Ease of Movement (EMV)
"EOM|1h|false|14"
Elder Ray Oscillator (Bull/Bear Power)
"BullsBears|1h|false|12"
Elliott Wave Oscillator (EWO)
"EWO|1h|false|5|35"
Intraday Momentum Index (IMI)
"IMI|1h|false|14"
Klinger Oscillator
"KVO|1h|false|34|55|13"
MACD
"MACD|1h|false|12|26|9"
Momentum Indicator
"Momentum|1h|false|10"
Money Flow Index (MFI)
"MoneyFlow|1h|false|10"
On Balance Volume (OBV)
"OBV|1h|false"
Percentage Price Oscillator(PPO)
"PPO|1h|false|9|18|9"
Price Oscillator (PO)
"PO|1h|false|9|18|9"
Rate of change (ROC)
"ROC|1h|false|10"
Relative strength index (RSI)
"RSI|1h|false|10"
Standard deviation
"StdDev|1h|false|10"
Stochastic Momentum Index (SMI)
"SMI|1h|false|3"
Stochastic RSI
"StochRSI|1h|false|14|3|3"
Stochastic oscillator
"Stochastic|1h|false|14|3|3"
Williams %R
"WilliamsR|1h|false|10"
The "Signature" field contains parameters separated by "|" (pipe) characters that define the settings for the indicator. The format of the "Signature" field is as follows:
"Indicator|Period|UseSignalLine|FastEMA|SlowEMA|SignalEMA"
"Indicator": Defines the indicator being used.
"Period": Specifies the time period or interval used for the calculations, such as "4h" for a 4-hour time frame.
"UseSignalLine": A boolean value (true or false) indicating whether to include a signal line alongside the line.
"FastEMA": The number of periods used for the calculation of the fast Exponential Moving Average (EMA).
"SlowEMA": The number of periods used for the calculation of the slow Exponential Moving Average (EMA).
"SignalEMA": The number of periods used for the calculation of the signal line, which is typically a 9-period EMA.
By providing the "Signature" value "MACD|4h|false|12|26|9" in the request, the endpoint is set to retrieve the MACD indicator data for the security with the specified parameters.
All parameters must be provided in the body JSON; otherwise the chart data will not be retrieved.
Here's the final template for this API request:
In response to this API request, you'll receive the chart data for the specified security. Some of the response data was omitted so as to preserve space.
where:
IsMarket
This field indicates if the candle is positioned during the regular trading hours. If so, the value will be set to true; if not, the value will be set to false.
Volume
This is the trading volume for the specified period.
OpenInterest
This is the total number of outstanding derivative contracts that have not been settled yet (only applicable for derivatives).
Time
This is the date and time (in ticks) at which this particular candle was registered.
DateTime
This is the date and time (in UTC time) at which this particular candle was registered.
Open
This is the opening price of the security.
Close
This is the closing price of the security.
High
This is the highest price point for the security during the specified time period.
Low
This is the lowest price point for the security during the specified time period.
Here are some of the common mistakes that developers make when attempting to retrieve trading data for a particular security.
Another common mistake when attempting to retrieve the chart data for a particular security is incorrectly structuring the request body. It's critical that you follow the template provided above and specify all of the required parameters. Otherwise you'll receive the 500 status code and the following error message:
The following article covers the syntax for this API request in detail.
This is the internal ID of the security in AutoShares. You can retrieve this ID with .
This is the beginning of the period for which the data will be retrieved. The value must be provided in .
This is the end of the period for which the data will be retrieved. The value must be provided in .