Introduction
This API call is used to retrieve the exponential moving average for the specified stock symbol over a specified period from a database and returns the results as JSON. The API call takes in the symbol, maxDate, and length as parameters and returns the exponential moving average data for the symbol.
Endpoint
/exponential-moving-average/:symbol/:maxDate/:lengthParameters
- symbol (string, required) – The stock symbol for which to retrieve historical data.
- maxDate (date, required) – The maximum date to include in the calculation. Format: ‘yyyy-mm-dd’.
- length (integer, required) – The number of days to calculate the moving average over. Valid values are 20, 50, 100 and 200.
Examples
List of several example calls, URLs, and responses to show users how to interact with the API call. These examples should include a variety of input parameters to demonstrate the different scenarios that the API call can handle.
- https://api.deltaneutral.net/exponential-moving-average/AAPL/2023-04-23/20?apikey=DEMOAPIKEY
- https://api.deltaneutral.net/exponential-moving-average/GOOG/2023-04-23/50?apikey=DEMOAPIKEY
Related Calls
None
Error Handling
If no data comes back, please check for valid input parameters.
Example Response
[{"length":"20",
"data":
[{"length":"20","data":
[{
"quotedate":"2023-04-21T00:00:00.000Z",
"sma":"155.56"
},
{
"quotedate":"2023-04-20T00:00:00.000Z",
"sma":"155.26"
},
{
"quotedate":"2023-04-19T00:00:00.000Z",
"sma":"154.82"
}
}]
}]