CFDs are complex instruments and come with a high risk of losing money rapidly due to leverage. 66 % of retail investor accounts lose money when trading CFDs with this provider. You should consider whether you understand how CFDs work and whether you can afford to take the high risk of losing your money.

[ANNOUNCEMENT] Darwin Info API 1.3 - Candles & Filters

Darwin Info API 1.3

A new version of the Darwin Info API is now available to use! New long expected methods are offered in this new version: Candles & query products using filters! :smiley:

1. Candles

The same data used in the web for displaying the candle graphs of each darwin can be retrieved through a couple of new methods offered for retrieving candles. At the moment we provide candles of different resolutions: 1m, 5m, 15m, 30m, 1h, 4h, 1d, 1w, 1mn, being m = minute, h = hour, d = day, w = week, mn = month.
Each candle have 5 values:

  • timestamp: epoch timestamp of the beginning of the candle.
  • open: first quote of the darwin in the period of the timestamp.
  • close: last quote of the darwin in the period of the timestamp.
  • max: maximum quote value reached.
  • min: minimum quote value reached.

One of the methods is used for retrieving candle info between an initial and a final timestamp. The second method is used to return the last candles in a timeframe:

1.1. Get candles in a period

GET /products/{productName}/candles

Return the candles for the darwin for a period of time starting in the “from” epoch timestamp and finishing in the “to” timestamp. The first candle returned will have a candle covering the from timestamp. Notice that it might happen that candles of lower resolution might be returned depending on the timestamps provided.

1.2. Get candles in a timeframe

GET /products/{productName}/candles/{timeframe}

Return the candles in the last timeframe provided. For instance, if timeframe = 1d then it should return the candles in the last day. In the same way as with the previous method, the resolution of candles returned might be lower than expected depending on the timeframe selected.

2. Retrieve products using Filters

POST /products

This expected functionality allows to use multiple filters to retrieve products accomplishing several requirements. Each “subfilter” can be based on different aspects and different periods. And the return can be ordered using other different aspect of the darwins in a particular period specified. For instance, it’s possible to retrieve products having a drawdown less than 10 percent in the last 6 months and return of more than 5 percent in the last month… and having the products ordered by return descending in the last year.

Some of the available filters are:

  • current_investment_usd
  • days_in_darwinex
  • divergence
  • drawdown
  • investors
  • return
  • return_drawdown
  • score
  • trader_equity
  • trades
  • tsScore
  • var

Some of the filters only allow a period of “actual” for the filtering, like the current investment, days in darwinex or divergence. The details of tested combinations can be found in the spec.

Request for the example mentioned above could be:

{
  "filter": [
    {
      "name": "drawdown",
      "options": [
        {
          "max": 0,
          "min": -10,
          "period": "6m"
        }
      ]
    }, {
      "name": "return",
      "options": [
        {
          "min": 5,
          "period": "1m"
        }
      ]
    }
  ],
  "order": "DESC",
  "orderField": "return",
  "page": 0,
  "perPage": 50,
  "period": "12m"
}

As usual, all clients have been granted access to this new version of the Darwin Info API. In order to use the new method the url without version can be directly used (https://api.darwinex.com/darwininfo/ ) or use the version 1.3 in the uri ( https://api.darwinex.com/darwininfo/1.3 )

8 Likes

@jesusbc when filtering via equity, the limitation of 10,000 max is NOT enforced in the api. Was this an oversight? Because I am looking at a pretty good estimates of actual equity of all Darwins… even the high ones.

Example -> DWC seems to have ~90k equity…

1 Like

@ignacio I compiled a list of all Darwins, their equities and their VAR. I wanted to publish this list, but I am unsure if I should go ahead because your normal interface hides equities > 10k.

Should I redact the cases where equity > 10k to 10k?
Edit: @ignacio can I get a response to this please?

@yhlasx I don’t find this information should be published until Darwinex publishes it.

1 Like

Very good job!!

That’s an amazing advancement!

Brilliant! That’s really necessary. Thanks.