Triangular Moving Average (TRIMA)

ta_trima


Results
Calculate Triangular Moving Average of a global symbol

Specification
Endpoint
ta_trima?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


Quick Examples

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": 37,
  "page_size": 37,
  "current_page": 1,
  "total_pages": 1,
  "results": {
    "symbol": "BTCUSD",
    "symbol_name": "Bitcoin/US Dollar",
    "exchange": "gemini",
    "symbol_pair": "BTC/USD",
    "technicals": [
      {
        "date": "2022-03-22",
        "trima": 39811.479
      },
      {
        "date": "2022-03-21",
        "trima": 39557.102
      },
      {
        "date": "2022-03-20",
        "trima": 39362.983
      },
      {
        "date": "2022-03-19",
        "trima": 39218.855
      },
      {
        "date": "2022-03-18",
        "trima": 39155.969
      },
      {
        "date": "2022-03-17",
        "trima": 39143.227
      },
      {
        "date": "2022-03-16",
        "trima": 39221.498
      },
      {
        "date": "2022-03-15",
        "trima": 39368.235
      },
      {
        "date": "2022-03-14",
        "trima": 39570.734
      },
      {
        "date": "2022-03-13",
        "trima": 39869.031
      },
      {
        "date": "2022-03-12",
        "trima": 40168.915
      },
      {
        "date": "2022-03-11",
        "trima": 40452.399
      },
      {
        "date": "2022-03-10",
        "trima": 40729.907
      },
      {
        "date": "2022-03-09",
        "trima": 40932.215
      },
      {
        "date": "2022-03-08",
        "trima": 40953.306
      },
      {
        "date": "2022-03-07",
        "trima": 40829.069
      },
      {
        "date": "2022-03-06",
        "trima": 40491.442
      },
      {
        "date": "2022-03-05",
        "trima": 40071.412
      },
      {
        "date": "2022-03-04",
        "trima": 39681.767
      },
      {
        "date": "2022-03-03",
        "trima": 39310.585
      },
      {
        "date": "2022-03-02",
        "trima": 38977.504
      },
      {
        "date": "2022-03-01",
        "trima": 38836.272
      },
      {
        "date": "2022-02-28",
        "trima": 38926.906
      },
      {
        "date": "2022-02-27",
        "trima": 39226.76
      },
      {
        "date": "2022-02-26",
        "trima": 39704.76
      },
      {
        "date": "2022-02-25",
        "trima": 40208.748
      },
      {
        "date": "2022-02-24",
        "trima": 40738.481
      },
      {
        "date": "2022-02-23",
        "trima": 41308.061
      },
      {
        "date": "2022-02-22",
        "trima": 41848.023
      },
      {
        "date": "2022-02-21",
        "trima": 42260.849
      },
      {
        "date": "2022-02-20",
        "trima": 42584.767
      },
      {
        "date": "2022-02-19",
        "trima": 42815.815
      },
      {
        "date": "2022-02-18",
        "trima": 42966.186
      },
      {
        "date": "2022-02-17",
        "trima": 43064.227
      },
      {
        "date": "2022-02-16",
        "trima": 43008.164
      },
      {
        "date": "2022-02-15",
        "trima": 42764.517
      },
      {
        "date": "2022-02-14",
        "trima": 42415.768
      }
    ]
  }
}

Examples

Get Triangula Exponential Moving Average with 14-day period for BTCUSD from 2019-12-01 to 2020-01-27

https://www.cryptoquote.io/analytics/v1/?api=ta_trima&symbol=BTCUSD.gdax&start_date=2019-12-01&end_date=2020-01-27&price_field=close_price&period=14&key=your_api_key
REST
GET https://www.cryptoquote.io/analytics/v1/?api=ta_trima&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_trima&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_trima&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_trima&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_trima&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_trima&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_trima&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_trima&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_trima&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);
});