Like all times in the framework, candle
For timeframes above H1, you can set a
For example, rather than requesting daily candles based on UTC days, you can instead say that you want aggregation based on UTC+2. This is extremely common in forex because the markets open at 5pm New York time on Sunday. If you request candles based on UTC, there are then six D1 candles per week, not five: candles for Monday to Friday, plus a stub of candle covering the period from 9pm/10pm UTC (5pm in New York) to midnight on Sunday.
Let's say that you request D1 candles aggregated based on UTC+2 (as illustrated below). Each daily candle will cover 24 hours. But its start time will not be midnight UTC. The
You can specify aggregation in your candle request using a
| Property | Type | Description |
| offset | Integer (number of minutes) | Base offset in minutes from UTC, e.g. 120 or -300. Note: although this |
| dstMode | Daylight savings mode. One of the values of the |
For example, the most common request for forex analysis looks like this:
Framework.RequestCandles({
instrumentId: "EUR/USD",
timeframe: 86400, // D1,
timezone: {
// 2 hours ahead of UTC, with USA daylight savings.
// Therefore, constant 7 hours ahead of New York time.
// Market open at 17:00 NYC on Sunday is reported as a candle ts of 00:00
offset: 120,
dstMode: FXB.DSTModes.USA
}
}, function (MsgCandles) {
…
});
This requests aggregation based on UTC+2, changing to UTC+3 on the USA daylight savings schedule. In effect, candles are aggregated based on a day running from 5pm-5pm New York time.
The further and very important thing to note is that the user can set a preference in the MyTrader platform for how candle data should be aggregated. If you do not explicitly set a
In other words: if you do not set your own
However, in your request you can also optionally specify