Technical Analysis API (1.0.0)

Download OpenAPI specification:

This document describes Autochartist Trading Opportunities.

API Request Authentication

Our APIs require the following url parameters on every call:

  • broker_id - your customer ID on our systems (provided to you)
  • user - a unique ID of the end-user consuming the information. For server-to-server integrations this would typically be your company name
  • account_type - 0 = LIVE, 1 = DEMO
  • expire - Unix timestamp of when this token will expire
  • token - a token generated by MD5(user|[account_type]|[expire][secret_key])

in which secret_key is the secret key provided to you, not to be shared with the end-user.

Note the '|' (pipe) character before and after the account_type parameter.

<?php
$expire      = time() + (3 * 24 * 60 * 60);
$userId      = "myuserid";
$accountType = "0";
$secretKey   = "secretkey";
$token = md5("{$userId}|{$accountType}|{$expire}{$secretKey}");
echo $token;
import hashlib
import time

expire = int(time.time()) + (3 * 24 * 60 * 60)
user_id = "myuserid"
account_type = "0"
secret_key = "secretkey"
token = hashlib.md5(
    f"{user_id}|{account_type}|{expire}{secret_key}".encode("utf-8")
).hexdigest()
print(token)

Technical Analysis

Technical trade setups

Returns latest pattern results for the specified symbol group category.

This endpoint also accepts a POST request carrying an optional user-configuration JSON body, used to override the stored user configuration for the pattern-results search.

User configuration is used to limit the pattern results search. The pattern search criteria include the following information:

  • patterns
  • pattern results
  • symbols
  • intervals
  • exchanges
  • age - number of candles
  • candles delay - For demo accounts, any pattern result with age less than 5 is excluded from the results.

Return format

  • Status 200 - application/json - latest pattern results.
  • The JSON object includes the following keys:
    • page - pagination configuration for pagination links.
    • items - a list of pattern result items.
      • new - indicate whether the data has been updated since the last request if any.
      • data - pattern result item - see "Fields" below.
      • links - an array of HATEOAS links for chart pattern images of different sizes displaying the price graph for the pattern result.

Fields

Note that some of the fields below may not be applicable to all analysis types.

  • result_type - The type of trade setup
  • result_uid - Internal unique identification numbers
  • direction - The direction of the forecast
  • prediction_price_from - The start of the forecast range
  • prediction_price_to - The end of the forecast range
  • pip - The size of a pip for this instrument
  • exchange - The exchange to which this symbol belongs
  • group_name - The logical group to which this symbol belongs
  • symbol - The TICKER
  • symbol_name - The long name of the symbol
  • symbol_id - Internal symbolID (ignore)
  • interval - The data interval on which this trade setup was identified
  • pattern - The name of the trade setup. If multiple locales are specified then this field will be an array
  • pattern_list - If multiple locales are specified then this field will be an array of language specific pattern names
  • complete - false when this trade setup is not yet fully formed. otherwise True.
  • identified - Date/Time when this trade setup was identified
  • age - The age in candles of the trade setup (difference between the current date and the identified date, divided by the 'interval')
  • length - The number of candles forming this trade setup
  • found - Internal timestamp. Ignore.
  • analysis_text - Text that describes the identified trade setup.
  • analysis_text_list - If multiple locales are specified then this field will be an array of language specific analysis_text
  • analysis_text_template - Text that describes the identified trade setup but the date portion of the text will be replaced by the {identified} identifier. This allows developers to customize the text for different timezones. If multiple locales are specified then this field will be an array
  • expires_at - A maximum date/time when this setup should be expired
  • signal_levels
    • entry_level - Entry for the signal
    • stop_loss - Stop Loss for the signal
    • target_level - Target price
    • target_period - Period within which the target price could hit
  • details - will only be returned if the parameter "include_detail" is set to true. For information about this field see the section "Get pattern result details"
  • drawing - will only be returned if the parameter "include_drawing" is set to true.

Requires authentication

A valid request with an authorized MD5 token will be accepted.

query Parameters
broker_id
required
integer
Example: broker_id=604

Your customer ID on our systems (provided to you).

user
required
string
Example: user=myuserid

A unique ID of the end-user consuming the information.

account_type
required
string
Example: account_type=LIVE

Account type: LIVE or DEMO (encoded as 0 = LIVE, 1 = DEMO in the token).

expire
required
integer
Example: expire=1691193600

Unix timestamp of when the token will expire.

token
required
string
Example: token=<your-md5-token>

MD5 token - see 'API Request Authentication'.

group
string
Example: group=all

The symbol group category to search (e.g. all).

locale
string
Example: locale=en

Locale for pattern/analysis text (e.g. en).

locales
string
Example: locales=en,tr,ru

Comma separated locales for multi-language results.

timezone
string
Example: timezone=UTC

Timezone applied to the returned date/time fields.

include_detail
boolean
Example: include_detail=true

Include the pattern detail payload for every item.

include_drawing
boolean
Example: include_drawing=true

Include the pattern drawing payload for every item.

page_limit
integer
Example: page_limit=20

Maximum number of items per page.

page_offset
integer

Zero-based page offset.

since
string
Example: since=2022-08-12T00:00:00Z

Only return results identified since this ISO-8601 timestamp.

Responses

Request samples

<?php
$params = http_build_query([
    "broker_id"       => 604,
    "user"            => "myuserid",
    "account_type"    => "LIVE",
    "expire"          => 1691193600,
    "token"           => $token,          // see "API Request Authentication"
    "group"           => "all",
    "locale"          => "en",
    "include_detail"  => "true",
    "include_drawing" => "true",
    "page_limit"      => 20,
    "page_offset"     => 0,
]);
$url = "https://api.autochartist.com/to/resources/results?" . $params;
$results = json_decode(file_get_contents($url), true);
print_r($results);

Response samples

Content type
application/json
Example
{}

Get pattern result details

Returns details of a pattern result item.

Return format

  • Status 200 - application/json - the pattern result item.
  • The JSON object includes the following keys:
    • new - indicate whether the data has been updated since the last request if any.
    • data - pattern result item. See "Fields" below.
    • links - an array of HATEOAS links for chart pattern images of different sizes displaying the price graph for the pattern result.

Fields

Below are the return fields. There are fields that are common to all analysis types, and some fields that are specific to each analysis type.

Common fields
  • symbol - The TICKER on which this trade setup was identified
  • exchange - The exchange to which this instrument belongs
  • short_name - The short name of the symbol
  • long_name - The long name of the symbols
  • age - The age (in candles) of the trade setup
  • complete - Is this trade fully formed or still in the process of forming.
  • direction - Direction of forecast
  • granularity - Data interval on which this setup was identified
  • forecast_minutes - The forecast in minutes
  • is_new - Is this a new setup since the last call to the API
  • length - the length of this trade setup in candles
  • pattern_start_time - The first candle in this trade setup
  • pattern_end_time - The last candle in this trade setup. Ignore if complete == false.
  • pattern_name - The name of the pattern that was identified
  • relevant - 1 = this trade setup is still relevant. 0 = trade expired
  • result_uid - unique identifier of a result
Fields specific to Chart Patterns
  • breakout - strength (between 0 and 1) of the breakout. -1 == no breakout yet
  • clarity - clarity of this pattern (between 0 and 1)
  • initial_trend - strength (between 0 and 1) of the initial trend
  • quality - overall pattern quality (between 0 and 1)
  • uniformity - uniformity (between 0 and 1) of the pattern
  • volume - strength (between 0 and 1) of the volume increase at point of breakout. Not applicable when breakout == -1
  • trend_change - Continuation / Reversal
  • qty_tp - quantity of turning points that make up this pattern
  • prediction_price_from - the start of the forecast area
  • prediction_price_to - the end of the forecast area
  • prediction_time_to - the date/time when this pattern expires
  • resistance_x0 / resistance_x1 - the x (date) coordinates of the resistance line
  • resistance_y0 / resistance_y1 - the y (price) coordinates of the resistance line
  • support_x0 / support_x1 - the x (date) coordinates of the support line
  • support_y0 / support_y1 - the y (price) coordinates of the support line
Fields specific to Fibonacci Patterns
  • averageQuality - The overall visual quality of the pattern
  • priceA / priceB / priceC / priceD / priceX - Price of points A-D and X (-1 if not applicable for this Fibonacci setup)
  • timeA / timeB / timeC / timeD / timeX - Date/time of points A-D and X. If year <= 1900 then ignore
  • ratioQuality - quality of the ratios of lines. Close to 1 means the proportions of the pattern are reaching the ideal
  • target03 ... target16 - the successive Fibonacci targets of the pattern
Fields specific to Key Levels
  • patternPrice - the price of the key level
  • approachingRegion - Price at which the opportunity was found to be approaching the key level. Applicable to emerging patterns only.
  • approachingTime - date/time when the pattern was deemed to be approaching.
  • atBarIdentified - the candle on which this pattern was found
  • atPriceIdentified - the price at which this pattern was identified
  • furthestPrice - the price that was furthest away from the key level
  • predictionPriceFrom - the start of the prediction area
  • predictionPriceTo - the end of the prediction area
  • predictionTimeFrom - the start of the forecast period
  • predictionTimeBars - the length (in candles) of the forecast
  • x0 ... x9 - the date/time of the successive touch points of the price graph. 1970-01-01 = ignore
Fields specific to Japanese Candlesticks
  • [None]

Requires authentication

A valid request with an authorized MD5 token will be accepted.

path Parameters
type
required
string
Example: KeyLevel

The pattern result type (e.g. KeyLevel, ChartPattern, Fibonacci).

uid
required
integer <int64>
Example: 600419182744698100

The unique identifier of the pattern result.

query Parameters
broker_id
required
integer
Example: broker_id=604

Your customer ID on our systems (provided to you).

user
required
string
Example: user=myuserid

A unique ID of the end-user consuming the information.

account_type
required
string
Example: account_type=LIVE

Account type: LIVE or DEMO (encoded as 0 = LIVE, 1 = DEMO in the token).

expire
required
integer
Example: expire=1691193600

Unix timestamp of when the token will expire.

token
required
string
Example: token=<your-md5-token>

MD5 token - see 'API Request Authentication'.

Responses

Request samples

<?php
$type = "KeyLevel";
$uid  = "600419182744698103";
$params = http_build_query([
    "broker_id"    => 604,
    "user"         => "myuserid",
    "account_type" => "LIVE",
    "expire"       => 1691193600,
    "token"        => $token,          // see "API Request Authentication"
]);
$url = "https://api.autochartist.com/to/resources/results/detail/{$type}/{$uid}?" . $params;
print_r(json_decode(file_get_contents($url), true));

Response samples

Content type
application/json
Example
{}

Get pattern result drawing data

Returns details of a pattern result item.

Return format

  • Status 200 - application/json - latest pattern results.

  • The JSON object includes the following keys:

    • page - pagination configuration for pagination links.
    • items - a list of pattern result items.
      • new - indicate whether the data has been updated since the last request if any.
      • data - pattern result item. See "Fields" below.
      • links - an array of HATEOAS links for chart pattern images of different sizes displaying the price graph for the pattern result.

Fields

Below are the return fields. There are fields that are common to all analysis types, and some fields that are specific to each analysis type.

Common fields
  • timeZone - Timezone of the timestamps in the resultset
  • symbol - The TICKER
  • chartType - The type (for example Chart Pattern)
  • interval - Data interval on which this setup was identified
  • length - the length of this trade setup in candles
  • direction - Direction of forecast
  • priceRange - the range of prices in this chart
    • low - the lowest price
    • to - the highest price
  • timeFrame - the time frame this trade setup spans
    • from - the first date in the range
    • to - the last date in the range
  • originalLines - Internal. Ignore.
  • lines - an array of lines that need to be drawn
    • x1 - timestamp of first point
    • y1 - price of first point
    • x2 - timestamp of second point
    • y2 - price of second point
    • name - logical name of this line (if applicable to this trade setup)
    • point1Name - logical name of first point (if applicable to this trade setup)
    • point2Name - logical name of second point (if applicable to this trade setup)
  • forecast - an array of lines that need to be drawn to represent the forecast
    • x1 - timestamp of first point
    • y1 - price of first point
    • x2 - timestamp of second point
    • y2 - price of second point
    • name - logical name of this line (if applicable to this trade setup)
    • point1Name - logical name of first point (if applicable to this trade setup)
    • point2Name - logical name of second point (if applicable to this trade setup)
  • eventLine - a vertical line representing the time of the event
    • x1 - timestamp of first point
    • y1 - price of first point
    • x2 - timestamp of second point
    • y2 - price of second point
    • name - logical name of this line (if applicable to this trade setup)
    • point1Name - logical name of first point (if applicable to this trade setup)
    • point2Name - logical name of second point (if applicable to this trade setup)
  • arrow - an array of lines that represent arrows that show the forecast direction
    • x1 - timestamp of first point
    • y1 - price of first point
    • x2 - timestamp of second point
    • y2 - price of second point
    • name - logical name of this line (if applicable to this trade setup)
    • point1Name - logical name of first point (if applicable to this trade setup)
    • point2Name - logical name of second point (if applicable to this trade setup)
  • predictionRectangle - an array of lines that represent the forecast region
    • x1 - timestamp of first point
    • y1 - price of first point
    • x2 - timestamp of second point
    • y2 - price of second point
    • name - logical name of this line (if applicable to this trade setup)
    • point1Name - logical name of first point (if applicable to this trade setup)
    • point2Name - logical name of second point (if applicable to this trade setup)

Requires authentication

A valid request with an authorized MD5 token will be accepted.

path Parameters
type
required
string
Example: KeyLevel

The pattern result type (e.g. KeyLevel, ChartPattern, Fibonacci).

uid
required
integer <int64>
Example: 600419182744698100

The unique identifier of the pattern result.

query Parameters
broker_id
required
integer
Example: broker_id=604

Your customer ID on our systems (provided to you).

user
required
string
Example: user=myuserid

A unique ID of the end-user consuming the information.

account_type
required
string
Example: account_type=LIVE

Account type: LIVE or DEMO (encoded as 0 = LIVE, 1 = DEMO in the token).

expire
required
integer
Example: expire=1691193600

Unix timestamp of when the token will expire.

token
required
string
Example: token=<your-md5-token>

MD5 token - see 'API Request Authentication'.

Responses

Request samples

<?php
$type = "KeyLevel";
$uid  = "600419182744698103";
$params = http_build_query([
    "broker_id"    => 604,
    "user"         => "myuserid",
    "account_type" => "LIVE",
    "expire"       => 1691193600,
    "token"        => $token,          // see "API Request Authentication"
]);
$url = "https://api.autochartist.com/to/resources/results/detail/drawing-data/{$type}/{$uid}?" . $params;
print_r(json_decode(file_get_contents($url), true));

Response samples

Content type
application/json
Example
{
  • "chartType": "KEY_LEVEL",
  • "interval": 60,
  • "length": 139,
  • "direction": "BEARISH",
  • "priceRange": {
    },
  • "timeFrame": {
    },
  • "originalLines": [ ],
  • "lines": [
    ],
  • "forecast": [
    ],
  • "eventLine": {
    },
  • "arrow": [
    ],
  • "predictionRectangle": [
    ],
  • "timeZone": "America/New_York",
  • "symbol": "GBPNZD"
}

Get Chart Image

Returns latest group pattern results for a specific broker. The pattern results are cached at every 5 minutes interval.

Return format

Image in image/png format.

Requires authentication

A valid request with an authorized MD5 token will be accepted.

path Parameters
type_uid
required
string
Example: KeyLevel_600419182744698103

Combined pattern result type and uid (e.g. KeyLevel_600419182744698103).

query Parameters
broker_id
required
integer
Example: broker_id=604

Your customer ID on our systems (provided to you).

user
required
string
Example: user=myuserid

A unique ID of the end-user consuming the information.

account_type
required
string
Example: account_type=LIVE

Account type: LIVE or DEMO (encoded as 0 = LIVE, 1 = DEMO in the token).

expire
required
integer
Example: expire=1691193600

Unix timestamp of when the token will expire.

token
required
string
Example: token=<your-md5-token>

MD5 token - see 'API Request Authentication'.

locale
string
Example: locale=en

Locale language tag (e.g. en).

width
integer
Example: width=320

Chart image width in px. Default is 320px.

height
integer
Example: height=240

Chart image height in px. Default is 240px.

Responses

Request samples

<?php
$typeUid = "KeyLevel_600419182744698103";
$params = http_build_query([
    "broker_id"    => 604,
    "user"         => "myuserid",
    "account_type" => "LIVE",
    "expire"       => 1691193600,
    "token"        => $token,          // see "API Request Authentication"
    "locale"       => "en",
    "width"        => 320,
    "height"       => 240,
]);
$url = "https://api.autochartist.com/to/charts/{$typeUid}.png?" . $params;
file_put_contents("chart.png", file_get_contents($url));

Response samples

Content type
image/png
Binary PNG image data - the rendered pattern chart.

Get pattern result analysis

Returns the plain-text market analysis for a single pattern result, identified by its type and uid.

The analysis text is localized: pass a locale (for example en, fr, tr) to select the language. When no locale is supplied it is resolved from the Accept-Language header, falling back to en_US. Unsupported locales fall back to English.

Return format

  • Status 200 - text/plain - the analysis text for the requested pattern result.
  • Status 204 - No Content - returned when no analysis text is available for the requested result.

Requires authentication

A valid request with an authorized MD5 token will be accepted.

path Parameters
type
required
string
Example: KeyLevel

The pattern result type (e.g. KeyLevel, ChartPattern, Fibonacci).

uid
required
integer <int64>
Example: 600419182744698100

The unique identifier of the pattern result.

query Parameters
broker_id
required
integer
Example: broker_id=604

Your customer ID on our systems (provided to you).

user
required
string
Example: user=myuserid

A unique ID of the end-user consuming the information.

account_type
required
string
Example: account_type=LIVE

Account type: LIVE or DEMO (encoded as 0 = LIVE, 1 = DEMO in the token).

expire
required
integer
Example: expire=1691193600

Unix timestamp of when the token will expire.

token
required
string
Example: token=<your-md5-token>

MD5 token - see 'API Request Authentication'.

locale
string
Example: locale=en

Locale for the analysis text (e.g. en, fr, tr).

Responses

Request samples

<?php
$type = "KeyLevel";
$uid  = "600419182744698103";
$params = http_build_query([
    "broker_id"    => 604,
    "user"         => "myuserid",
    "account_type" => "LIVE",
    "expire"       => 1691193600,
    "token"        => $token,          // see "API Request Authentication"
    "locale"       => "en",
]);
$url = "https://api.autochartist.com/to/resources/results/analysis/{$type}/{$uid}?" . $params;
echo file_get_contents($url);

Response samples

Content type
text/plain
Rising Wedge has broken through the support line at 8/12 14:00. Possible bearish price movement forecast for the next 11 hours towards 133.13.

Localization

Returns the localized labels (translations) used to render pattern names, directions and interface strings for a given language.

Pass the required lang parameter (for example en, fr, tr) to select the language. The response is a flat JSON object of translation keys mapped to their localized values.

Return format

  • Status 200 - application/json - a JSON object of key -> localized value pairs.

Requires authentication

A valid request with an authorized MD5 token will be accepted.

query Parameters
lang
required
string
Example: lang=en

Language to return translations for (e.g. en, fr, tr).

broker_id
required
integer
Example: broker_id=604

Your customer ID on our systems (provided to you).

user
required
string
Example: user=myuserid

A unique ID of the end-user consuming the information.

account_type
required
string
Example: account_type=LIVE

Account type: LIVE or DEMO (encoded as 0 = LIVE, 1 = DEMO in the token).

expire
required
integer
Example: expire=1691193600

Unix timestamp of when the token will expire.

token
required
string
Example: token=<your-md5-token>

MD5 token - see 'API Request Authentication'.

Responses

Request samples

<?php
$params = http_build_query([
    "lang"         => "en",
    "broker_id"    => 604,
    "user"         => "myuserid",
    "account_type" => "LIVE",
    "expire"       => 1691193600,
    "token"        => $token,          // see "API Request Authentication"
]);
$url = "https://api.autochartist.com/to/resources/translations?" . $params;
print_r(json_decode(file_get_contents($url), true));

Response samples

Content type
application/json
{
  • "keylevel": "Key Level",
  • "chartpattern": "Chart Pattern",
  • "fibonacci": "Fibonacci",
  • "direction.bullish": "Bullish",
  • "direction.bearish": "Bearish",
  • "trend_change.reversal": "Reversal",
  • "trend_change.continuation": "Continuation",
  • "interval.60": "1 hour",
  • "interval.240": "4 hours",
  • "interval.1440": "1 day"
}