API: How To Request Traditional 4 Box Renko Via API?

I’m having trouble requesting a traditional 4 box renko chart via the API. I’ve been able to easily request minute and tick chart data. But for some reason having trouble with the Renko. I realize the API docs referenced:

Get Chart

Description: Client may have multiple charts for the same contract, so the response for md/getChart request contains a subscription ID to properly track and unsubscribe from a real-time chart subscription. If you’re using JavaScript, don’t forget to check the section on charts in our API’s comprehensive JavaScript tutorial.

Endpoint: md/getChart

Parameters:

{
  "symbol":"ESM7" | 123456,
  "chartDescription": {
    "underlyingType":"MinuteBar", // Available values: Tick, DailyBar, MinuteBar, Custom, DOM
    "elementSize":15,
    "elementSizeUnit":"UnderlyingUnits", // Available values: Volume, Range, UnderlyingUnits, Renko, MomentumRange, PointAndFigure, OFARange
    "withHistogram": true | false
  },
  "timeRange": {
    // All fields in "timeRange" are optional, but at least anyone is required
    "closestTimestamp":"2017-04-13T11:33Z",
    "closestTickId":123,
    "asFarAsTimestamp":"2017-04-13T11:33Z",
    "asMuchAsElements":66
  },
}

So far I’ve tried the following with no success. Could really use some help here. The api docs are pretty ambiguous when it comes to requesting renko data:

{
    elementSize: 4,
    elementSizeUnit: "Seconds",
    underlyingType: "Renko",
    boxSize: 4 // 4 point bricks
  }

{
    elementSize: 4,
    elementSizeUnit: "Renko",
    underlyingType: "Tick",
    boxSize: 4 // 4 point bricks
  },

Hi pardo7, to request a traditional 4-box renko chart, try this format:

json

CopyEdit

{
  "symbol": "ESM7",
  "chartDescription": {
    "underlyingType": "Custom",
    "elementSize": 4,
    "elementSizeUnit": "Renko",
    "withHistogram": false
  },
  "timeRange": {
    "asMuchAsElements": 100
  }
}

make sure you’re using underlyingType: "Custom" and elementSizeUnit: "Renko", not underlyingType: "Renko". also, check that your API supports renko charts for your data source. hope this helps!

Hi Johann_Birle, appreciate the help. Just gave it a shot, the following error was thrown:


FAILED:
	operation 'md/getchart'
	query 
	body {
  "symbol": "@MNQ",
  "chartDescription": {
    "underlyingType": "Custom",
    "elementSize": 4,
    "elementSizeUnit": "Renko",
    "withHistogram": false
  },
  "timeRange": {
    "asMuchAsElements": 2000
  },
  "p-ticket": "JwhvaL3j03hqkROADaS3G_tABfb0Jk2nCoimIQHVkMk-B5QjgSa5KjQnsN38GZqIR3j_9XzGBKcTCfvOWNxO"
}
	reason '"{\"violations\":[{\"constraint\":\"customUnderlying\",\"value\":\"None\",\"description\":\"Custom Underlying should be specified\"}]}"'

This was the complete request payload I sent in:

{
  symbol: "@MNQ",
  chartDescription: {
    underlyingType: "Custom",
    elementSize: 4,
    elementSizeUnit: "Renko",
    withHistogram: false,
  },
  timeRange: {
    asMuchAsElements: 2000,
  },
}

Hey @Pardo7 — welcome! :waving_hand:

For traditional 4-point Renko via API, you’ll want to structure your request like this:

json

CopyEdit

{
  "symbol": "ESM7",
  "chartDescription": {
    "underlyingType": "Custom",
    "elementSize": 4,
    "elementSizeUnit": "Renko",
    "withHistogram": false
  },
  "timeRange": {
    "asMuchAsElements": 100
  }
}

Let me know if it works or throws errors — happy to help debug further