ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Could you plz provide Multithreading Real-Time Chart example for Financial chart?
Posted by kevin on Aug-07-2020 21:11
Attachments:
Dear. Peter Kwan
At first, I need to say Thank you so much for Great library.
Recently, I'm trying to develop real-time chart but it's a little hard to me.

Could you plz provide Multithreading Real-Time Chart example for Financial chart?

And I have 2 question for this project.

1. why candle stick fit all around main chart area?
2. how to show x label every 30min? now it's 1hour period.

Thank you in advance.
chart1.png
chart2.png
chart5.png

  Re: Could you plz provide Multithreading Real-Time Chart example for Financial chart?
Posted by Peter Kwan on Aug-08-2020 16:16
Hi Kevin,

In a FinanceChart, the chart always reflects your data. If you have 100 timestamps, the chart can fit 100 candlesticks, and each candlestick position will then be around 1/100 of the chart. If your data only has 3 timestamps, then the chart will fit 3 candlesticks.

If you want the candlesticks to be smaller, fit determine how many candlesticks can the chart have, then create the timestamps for those candlesticks. For example, if each candlestick represent 5 minutes, and you want to plot 8 trading hours, please create 96 timestamps for the 96 candlestick positions.

Even if you only have data for 3 candlesticks, you must still create a timeStamp array with 96 elements, while the high/low/open/close/vol arrays can have 3 elements. Without the timestamp array, it is not possible to know how wide the candlesticks should be. It is also not possible to automatically determine the timestamps, because very stock exchange is different. (For example, some stock exchanges may have lunch hours with no timestamps, while other stock exchanges may not have lunch hours. For FOREX trading, the trading can occur 24 hours continuously.)

For the multi-threading realtime chart, normally, it is for charts that updates many times per second. If the chart only updates once per second or slower, multi-threading may be unnecessary. In any case, I will create a simple example for you, which should be available by Monday.

Regards
Peter Kwan

  Re: Could you plz provide Multithreading Real-Time Chart example for Financial chart?
Posted by Peter Kwan on Aug-11-2020 02:54
Attachments:
Hi Kevin,

I have just modified the "realtimemultithread" sample code to make a financial chart. To try it, please replace the original "realtimemultithread" folder in the original sample code with the "realtimemultithread" folder in the attached zip file. You can then compile and run the code.

Regards
Peter Kwan
realtimemultithread_finance.zip
realtimemultithread_finance.zip

47.70 Kb

  Re: Could you plz provide Multithreading Real-Time Chart example for Financial chart?
Posted by kevin on Aug-11-2020 21:20
Hi, Peter Kwan

I checked your example code. and it's working fine.
Thank you.

But there is no Auto scroll function which I expected.
May I ask you to modify it include Auto scroll?
And also need to show 30min period time label.

Best regard.

  Re: Could you plz provide Multithreading Real-Time Chart example for Financial chart?
Posted by Peter Kwan on Aug-13-2020 02:20
Attachments:
Hi Kevin,

I have modified the sample code to use 30 min labels, and to modify it so the axis behave like the original Multithreading Real Time Chart sample code (with auto-scrolling). For testing, I increase the speed by 200 times, so the candlesticks can appear faster.

Regards
Peter Kwan
realtimemultithread_finance_20200812.zip
realtimemultithread_finance_20200812.zip

48.17 Kb

  Re: Could you plz provide Multithreading Real-Time Chart example for Financial chart?
Posted by kevin on Aug-22-2020 09:28
Hi, Peter Kwan

I've tested Multithreading Real-Time Chart including your example on real Nasdaq 100 Future market for 1 week. then it's working nice. no exception. no memory leak.
I really appreciate you.

Best regard.