Version: 1.0.0
Custom interval
The CustomInterval module allows developers to register custom timeframe intervals that appear in the chart's resolution dropdown.
Overview
Intervals are registered via window.ChartingAPI.registerCustomInterval(intervalString). The chart toolbar will automatically group them by unit (seconds, minutes, hours, days, weeks, months).
Interval Format
| Suffix | Unit | Examples |
|---|---|---|
| S | Seconds | '10S', '30S' |
| m | Minutes | '1m', '5m', '45m' |
| H | Hours | '1H', '4H', '12H' |
| D | Days | '1D', '3D' |
| W | Weeks | '1W', '2W' |
| M | Months | '1M', '3M' |
Registering Intervals
// Register custom intervals in custom-interval.js
window.ChartingAPI.registerCustomInterval('1m');
window.ChartingAPI.registerCustomInterval('5m');
window.ChartingAPI.registerCustomInterval('30m');
window.ChartingAPI.registerCustomInterval('1D');
window.ChartingAPI.registerCustomInterval('1m');
window.ChartingAPI.registerCustomInterval('5m');
window.ChartingAPI.registerCustomInterval('30m');
window.ChartingAPI.registerCustomInterval('1D');