Exponential Moving Average (EMA)

ta_ema


Results
Calculate Exponential Moving Average of a global symbol

Specification
Endpoint
ta_ema?symbol={symbol}&start_data={start_date}&end_date={end_date}&price_field={price_field}&period={period}

Support
Current and Historical values

API Call Counts
20 per API call.

API Plan
bronze



Input Parameters
symbol

The common/local symbol/ticker of the symbol

Example : BTCUSD


start_date

Start Date

Example : 2019-01-01


end_date

End Date

Example : 2019-01-01


price_field

The price field to use when calculating the technical indicators. Allowed values are;

open_price = Open Price
high_price = High Price
low_price = Low_price
close_price = Close Price
volume = Volume

Example : close_price


period

The Period value for the technical indicator e.g. 14 means 14-day period

Example : 14



Output Descriptions
symbol

The common/local symbol/ticker of the symbol

Type: string


symbol_name

The name of the symbol

Type: string


exchange

the exchange code e.g. gemini

Type: string


symbol_pair

the exchange symbol pairs

Type: string



Sample Output
{
  "status": "ok",
  "total_records": 46,
  "page_size": 46,
  "current_page": 1,
  "total_pages": 1,
  "results": {
    "symbol": "BTCUSD",
    "symbol_name": "Bitcoin/US Dollar",
    "exchange": "gemini",
    "symbol_pair": "BTC/USD",
    "technicals": [
      {
        "date": "2022-03-09",
        "ema": 40167.85
      },
      {
        "date": "2022-03-08",
        "ema": 39889.466
      },
      {
        "date": "2022-03-07",
        "ema": 40061.514
      },
      {
        "date": "2022-03-06",
        "ema": 40378.67
      },
      {
        "date": "2022-03-05",
        "ema": 40678.704
      },
      {
        "date": "2022-03-04",
        "ema": 40873.65
      },
      {
        "date": "2022-03-03",
        "ema": 41136.057
      },
      {
        "date": "2022-03-02",
        "ema": 40932.195
      },
      {
        "date": "2022-03-01",
        "ema": 40470.054
      },
      {
        "date": "2022-02-28",
        "ema": 39859.101
      },
      {
        "date": "2022-02-27",
        "ema": 39331.042
      },
      {
        "date": "2022-02-26",
        "ema": 39581
      },
      {
        "date": "2022-02-25",
        "ema": 39650.348
      },
      {
        "date": "2022-02-24",
        "ema": 39715.328
      },
      {
        "date": "2022-02-23",
        "ema": 39925.832
      },
      {
        "date": "2022-02-22",
        "ema": 40336.815
      },
      {
        "date": "2022-02-21",
        "ema": 40656.076
      },
      {
        "date": "2022-02-20",
        "ema": 41216.739
      },
      {
        "date": "2022-02-19",
        "ema": 41652.657
      },
      {
        "date": "2022-02-18",
        "ema": 41890.042
      },
      {
        "date": "2022-02-17",
        "ema": 42183.815
      },
      {
        "date": "2022-02-16",
        "ema": 42436.597
      },
      {
        "date": "2022-02-15",
        "ema": 42213.937
      },
      {
        "date": "2022-02-14",
        "ema": 41852.321
      },
      {
        "date": "2022-02-13",
        "ema": 41745.223
      },
      {
        "date": "2022-02-12",
        "ema": 41693.765
      },
      {
        "date": "2022-02-11",
        "ema": 41609.427
      },
      {
        "date": "2022-02-10",
        "ema": 41487.542
      },
      {
        "date": "2022-02-09",
        "ema": 41174.144
      },
      {
        "date": "2022-02-08",
        "ema": 40674.931
      },
      {
        "date": "2022-02-07",
        "ema": 40151.962
      },
      {
        "date": "2022-02-06",
        "ema": 39579.573
      },
      {
        "date": "2022-02-05",
        "ema": 39143.26
      },
      {
        "date": "2022-02-04",
        "ema": 38792.913
      },
      {
        "date": "2022-02-03",
        "ema": 38360.522
      },
      {
        "date": "2022-02-02",
        "ema": 38521.219
      },
      {
        "date": "2022-02-01",
        "ema": 38770.9
      },
      {
        "date": "2022-01-31",
        "ema": 38778.177
      },
      {
        "date": "2022-01-30",
        "ema": 38820.973
      },
      {
        "date": "2022-01-29",
        "ema": 38959.439
      },
      {
        "date": "2022-01-28",
        "ema": 39080.095
      },
      {
        "date": "2022-01-27",
        "ema": 39285.578
      },
      {
        "date": "2022-01-26",
        "ema": 39604.925
      },
      {
        "date": "2022-01-25",
        "ema": 40032.381
      },
      {
        "date": "2022-01-24",
        "ema": 40500.758
      },
      {
        "date": "2022-01-23",
        "ema": 41084.578
      }
    ]
  }
}

REST
GET https://www.cryptoquote.io/analytics/v1/?api=ta_ema&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key
Python
import requests 
r = requests.get("https://www.cryptoquote.io/analytics/v1/?api=ta_ema&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key")
data = r.json()
print(data)
Node.js
var http = require('http');
var buffer = '';
var options = {
	host: 'https://www.cryptoquote.io/analytics/v1/?api=ta_ema&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key',
	port: 80,
	path: 'https://www.cryptoquote.io/analytics/v1/?api=ta_ema&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key',
	headers: headers
};
callback = function(response) {
	response.on('data', function (chunk) {
	buffer += chunk;
});
response.on('end', function () {
	// your code here if you want to use the results !
});
}

var req = http.get(options, callback).end();
C#
using (var client = new HttpClient())
{
	client.BaseAddress = new Uri("{$api_host}");
	client.DefaultRequestHeaders.Clear();
	//ADD Acept Header to tell the server what data type you want
	client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
	//SET Parameters
	HttpResponseMessage response = await client.GetAsync("https://www.cryptoquote.io/analytics/v1/?api=ta_ema&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key");
	if (response.IsSuccessStatusCode)
	{
		//Your custom response parser code
	}
}
Java
String uri = "https://www.cryptoquote.io/analytics/v1/?api=ta_ema&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key";
URL url = new URL(uri);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
	connection.setRequestMethod("GET");
	connection.setRequestProperty("Accept", "application/json");
InputStream xml = connection.getInputStream();
R
1 - Install package
install.packages("RCurl")
install.packages("jsonlite")
2 - Request the data:
library('RCurl')
require('jsonlite')
json <- getURL(URLencode('https://www.cryptoquote.io/analytics/v1/?api=ta_ema&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key'))
obj <- fromJSON(json)
PHP
$url = 'https://www.cryptoquote.io/analytics/v1/?api=ta_ema&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key';
$handle = curl_init(); 
	curl_setopt($handle, CURLOPT_URL, $url);
	curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);

	$data = curl_exec($handle);
curl_close($handle);
//parse your data as per your needs....
Javascript
var url = 'https://www.cryptoquote.io/analytics/v1/?api=ta_ema&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key';
$.ajax({
		url: url,
		type: "GET",
		dataType: 'json'
}).done(function (data) {
	console.log(data);
});