highchartstypeerrorcandlestick-chartforextrendline

TypeError: Cannot read properties of undefined (reading 'hour') when replacing the sample data using MT5 Data


I was trying to use draggable trendline on top of CANDLESTICK series it's working okay until I replace the data from "https://demo-live-data.highcharts.com/aapl-ohlc.json" with a data from mt5.

I was thinking that it's because the mt5 data have saturday and sunday break. but I also think I was not providing the data with proper time interval? does Highstock charts require a specific timeframe? or is there any settings I can use to work with 5mins, 15minutes, 30minutes, 1hour, 1 day timeframe?

enter image description here

I did try to get 1 minute time frame but Its too many to load if I just want to view data with 1 hour timeframe


Solution

  • Highcharts Stock accepts the weekend breaks (or any other breaks) without any problem, due to the ordinal implementation. Therefore, your dataset only has to be sorted (in ascending order) and can contain breaks. The timeframe of the points is entirely up to you, and it can even be changed internally via data grouping.

    However, make sure to use the correct data format require by candlestick series.

    If you would like to use draggable-points module with Highcharts Stock, remember to disable dataGrouping for series that will be draggable. This module runs Point.update() underneath, which can only be used on non-grouped datasets.