Moving Average Convergence Divergence

Moving Average Convergence Divergence R API Documentation

Moving average convergence divergence (MACD) is a trend-following momentum oscillator that consists of three indicators: (1) a 12 period short-term exponential moving average (EMA) a 26 period long-term EMA and a 9 period EMA signal line. Traders using MACD often look for signal line crossovers, centerline crossovers, and EMA divergences to indicate the momentum and underlying trend of a security`s price.

API Class:
IntrinioSDK::SecurityApi
Instance Method:
get_security_price_technicals_macd()

Stock Price Code Example

Use my API Key
client <- IntrinioSDK::ApiClient$new()
# Configure API key authorization: ApiKeyAuth
client$configuration$apiKey <- "YOUR_API_KEY"
#Configure retries
client$configuration$allowRetries <- TRUE
# Setup API with client
SecurityApi <- IntrinioSDK::SecurityApi$new(client)
# Required params
identifier <- "AAPL"
# Optional params
opts <- list(
fast_period = 12,
slow_period = 26,
signal_period = 9,
price_key = "close",
start_date = "2018-01-01",
end_date = "2019-01-01",
page_size = 100,
next_page = NULL
)
response <- SecurityApi$get_security_price_technicals_macd(identifier, opts)
print(response)
print(response$content)
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Parameters

NameTypeDescriptionNotes
identifierCharacterA Security identifier (Ticker, FIGI, ISIN, CUSIP, Intrinio ID) 
fast_periodIntegerThe number of observations, per period, to calculate the fast moving Exponential Moving Average for Moving Average Convergence Divergence[optional] [default to 12]  
slow_periodIntegerThe number of observations, per period, to calculate the slow moving Exponential Moving Average for Moving Average Convergence Divergence[optional] [default to 26]  
signal_periodIntegerThe number of observations, per period, to calculate the signal line for Moving Average Convergence Divergence[optional] [default to 9]  
price_keyCharacterThe Stock Price field to use when calculating Moving Average Convergence Divergence[optional] [default to close]  
start_dateCharacterReturn technical indicator values on or after the date[optional]  
end_dateCharacterReturn technical indicator values on or before the date[optional]  
page_sizeIntegerThe number of results to return[optional] [default to 100]  
next_pageCharacterGets the next page of data from a previous API call[optional]  


Return Type

object
IntrinioSDK::ApiResponseSecurityMovingAverageConvergenceDivergence

Properties

NameTypeDescription
technicalsList of MovingAverageConvergenceDivergenceTechnicalValue 
technicals_data_frameData FrameData frame representation of technicals
indicatorTechnicalIndicatorThe name and symbol of the technical indicator  
securitySecuritySummaryThe Security of the Stock Price  
next_pageCharacterThe token required to request the next page of the data. If null, no further results are available.  
object
IntrinioSDK::MovingAverageConvergenceDivergenceTechnicalValue

Properties

NameTypeDescription
date_timePOSIXltThe date_time of the observation  
macd_histogramNumericThe histogram value of the Moving Average Convergence Divergence calculation  
macd_lineNumericThe line value of the Moving Average Convergence Divergence calculation  
signal_lineNumericThe signal line value of the Moving Average Convergence Divergence calculation  
object
IntrinioSDK::TechnicalIndicator

Properties

NameTypeDescription
nameCharacterThe name of the Technical Indicator  
symbolCharacterThe symbol of the Technical Indicator  
object
IntrinioSDK::SecuritySummary

Properties

NameTypeDescription
idCharacterThe Intrinio ID for Security  
company_idCharacterThe Intrinio ID for the Company for which the Security is issued  
nameCharacterThe name of the Security  
codeCharacterA 2-3 digit code classifying the Security (reference)  
currencyCharacterThe currency in which the Security is traded on the exchange  
tickerCharacterThe common/local ticker of the Security  
composite_tickerCharacterThe country-composite ticker of the Security  
figiCharacterThe OpenFIGI identifier  
composite_figiCharacterThe country-composite OpenFIGI identifier  
share_class_figiCharacterThe global-composite OpenFIGI identifier  
primary_listingLogicalIf TRUE, the Security is the primary issue for the company, otherwise it is a secondary issue on a secondary stock exchange