gareth-ib
Posts: 9
Joined: Thu Sep 27, 2018 8:25 pm

Candle streaming updates

Could you please add a demo of a candle or OHLC chart with dynamically updating data?
like ...
https://www.highcharts.com/stock/demo/dynamic-update

but using candles like on

https://www.highcharts.com/stock/demo/candlestick

so that any candle size will work along with the data grouping that seems to be required in that style chart.
I've seen posts on here and StackOverflow of people with problems with this, as well as myself on a past project.

thanks
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Candle streaming updates

Hi, gareth-ib!

Are you looking for something like this? https://jsfiddle.net/BlackLabel/uparh9xo/

Best regards
Rafal Sebestjanski,
Highcharts Team Lead
gareth-ib
Posts: 9
Joined: Thu Sep 27, 2018 8:25 pm

Re: Candle streaming updates

hey Rafal S,

not exactly.. cuz that is just appending to the chart. As opposed to in a real streaming scenario, the latest 1 minute candle would be getting multiple updates from activity during that minute, then eventually a new minute would come and need to add a new candle. The problem is updating a candle as opposed to only adding candles.

So to clarify.. by "update data" I do not mean the same as adding data.

thanks
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Candle streaming updates

gareth-ib,

Sorry but I don't quite understand the idea of updating your data and candles. You can do whatever you want with data - you can add new points or you can update last points and I can show you how to do both - but you would need to give me some sample data and explain precisely how you would like it to work.

Kind regards
Rafal Sebestjanski,
Highcharts Team Lead
gareth-ib
Posts: 9
Joined: Thu Sep 27, 2018 8:25 pm

Re: Candle streaming updates

yes I want to update data. The "AAPL" data feed would be fine. Just like how all trading sites work, for instance:
https://pro.coinbase.com/trade/ETH-USD

if you are zoomed to the 1minute candles... you'll see that 1 minute candle change shape during that 1 minute of time as transactions occur and expand the range of values for that candle.
The same thing happens at whatever level of zoom you are at

or like the problem this person was having: https://stackoverflow.com/questions/410 ... art-points

make sense? Thanks
rafalS
Posts: 2665
Joined: Thu Jun 14, 2018 11:40 am

Re: Candle streaming updates

So you want to add a new point every minute so new candle appears but during that minute low and high values of our candle might change so you want to update candle to show changes, for example, every 6 seconds (10 times for one candle)?
Rafal Sebestjanski,
Highcharts Team Lead
guptamohit
Posts: 3
Joined: Wed Nov 18, 2020 8:18 pm

Re: Candle streaming updates

Hello,

We are also facing problem in same.
Can you explain how live candlestick streaming works with it.
Open high low close values will keep changing

Need example in Angular please

http://jsfiddle.net/m2P5a/ is similar example but its in javascript. Can some one give live demo in angular.

So we want to update existing candle open high low close till a new time candle is received
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Candle streaming updates

Hi,
Thanks for contacting us with your question!

I try to create a simple template in Angular for type candlestick, but I have a type errors.

Here is example from our angular wrapper with how to resolve this error:
https://stackblitz.com/edit/highcharts- ... n-type-yyy

Angular simple template chart type candlestick:
https://stackblitz.com/edit/highcharts- ... -mi-sa3rze

API References:
https://api.highcharts.com/highstock/se ... stick.data
https://github.com/highcharts/highcharts-angular

If you have any problem with the implementation, I will help you.
Best regards.
Sebastian Hajdus
Highcharts Developer
guptamohit
Posts: 3
Joined: Wed Nov 18, 2020 8:18 pm

Re: Candle streaming updates

Hello,
You have not got my question Right

1> I want to know an angular example on how to create Candlestick chart with Live streaming data.
It means that last candle will keep changing with new values.

I already know hoe to implement candlestick in angular, main thing is how to use Remove Point and Add Point methods to remove and add candles dynamically in Angular wrapper of highcharts
User avatar
sebastian.h
Posts: 1734
Joined: Fri Aug 07, 2020 7:08 am

Re: Candle streaming updates

Hi,

I prepared a demo with the same example as in your demo. The basis was a simplified example with the candlestick in Angular 8.
But I'm not sure why on my stackblitz this solution doesn't work, if you find out let me know :)

Live demo in Angular with updating candlestick series each second:
https://codesandbox.io/s/angular-forked-qwq11

Best regards.
Sebastian Hajdus
Highcharts Developer

Return to “Highcharts Stock”