Plot different bar count charts
Author: Rebelion
Creation Date: 12/23/2012 7:11 PM
profile picture

Rebelion

#1
Hello, guys.

Now I have the problem with charts. I have ticks data which I use to produce my own candles. But I have a problem, because I can't plot my candles correct - when I use CreatePane and PlotSymbol, I have an exception connected with different count of bars in charts. When I use Synchronize, I have nothing good, cause it needs to set datatime element correct when I create new bar in my new Bars object.

An error:"Plotted DataSeries has fewer bars than the Symbol being charted".

This is a dummy code example:

CODE:
Please log in to see this code.


Could anyone give me a good solution of this problem?

P.S. data provider - ascii, data example seem below.

10:00:51 140780.0 RI 2012-09-04 10:00:51
10:00:52 140770.0 RI 2012-09-04 10:00:52
10:00:53 140750.0 RI 2012-09-04 10:00:53
10:00:55 140740.0 RI 2012-09-04 10:00:54
10:00:55 140735.0 RI 2012-09-04 10:00:55
10:00:56 140750.0 RI 2012-09-04 10:00:56
10:00:58 140755.0 RI 2012-09-04 10:00:57
10:00:59 140770.0 RI 2012-09-04 10:00:58
10:01:00 140755.0 RI 2012-09-04 10:00:59
10:01:00 140790.0 RI 2012-09-04 10:01:00
10:01:02 140775.0 RI 2012-09-04 10:01:01
10:01:03 140770.0 RI 2012-09-04 10:01:02
10:01:04 140790.0 RI 2012-09-04 10:01:03
10:01:04 140795.0 RI 2012-09-04 10:01:04
10:01:05 140805.0 RI 2012-09-04 10:01:05
10:01:06 140805.0 RI 2012-09-04 10:01:06
10:01:07 140800.0 RI 2012-09-04 10:01:07
10:01:09 140805.0 RI 2012-09-04 10:01:08
10:01:10 140805.0 RI 2012-09-04 10:01:09
10:01:10 140790.0 RI 2012-09-04 10:01:10
10:00:51 140780.0 RI 2012-09-04 10:00:51
10:00:52 140770.0 RI 2012-09-04 10:00:52
10:00:53 140750.0 RI 2012-09-04 10:00:53
10:00:55 140740.0 RI 2012-09-04 10:00:54
10:00:55 140735.0 RI 2012-09-04 10:00:55
10:00:56 140750.0 RI 2012-09-04 10:00:56
10:00:58 140755.0 RI 2012-09-04 10:00:57
10:00:59 140770.0 RI 2012-09-04 10:00:58
10:01:00 140755.0 RI 2012-09-04 10:00:59
10:01:00 140790.0 RI 2012-09-04 10:01:00
10:01:02 140775.0 RI 2012-09-04 10:01:01
10:01:03 140770.0 RI 2012-09-04 10:01:02
10:01:04 140790.0 RI 2012-09-04 10:01:03
10:01:04 140795.0 RI 2012-09-04 10:01:04
10:01:05 140805.0 RI 2012-09-04 10:01:05
10:01:06 140805.0 RI 2012-09-04 10:01:06
10:01:07 140800.0 RI 2012-09-04 10:01:07
10:01:09 140805.0 RI 2012-09-04 10:01:08
10:01:10 140805.0 RI 2012-09-04 10:01:09
10:01:10 140790.0 RI 2012-09-04 10:01:10
10:01:11 140790.0 RI 2012-09-04 10:01:11
10:01:12 140795.0 RI 2012-09-04 10:01:12
10:01:13 140780.0 RI 2012-09-04 10:01:13
10:01:14 140820.0 RI 2012-09-04 10:01:14
10:01:16 140790.0 RI 2012-09-04 10:01:15
10:01:16 140800.0 RI 2012-09-04 10:01:16
10:01:18 140825.0 RI 2012-09-04 10:01:17
10:01:18 140870.0 RI 2012-09-04 10:01:18
10:01:19 140865.0 RI 2012-09-04 10:01:19
10:01:20 140880.0 RI 2012-09-04 10:01:20

profile picture

Eugene

#2
CODE:
Please log in to see this code.

Why are you trying to produce a tick-based Bars object out of the second-based data source? Shouldn't it be the other way round?
CODE:
Please log in to see this code.

Synchronizing the new Bars object is a must because its bars count is not equal to the primary Bars object.

profile picture

Rebelion

#3
It's real ticks data - just no miliseconds information I have, but I can add this too. Does any mechanism to plot my new graph as a main graph on the pane exist here? Or what the correct solution of this task? :(
profile picture

Eugene

#4
QUOTE:
Or what the correct solution of this task? :(

I face no problem running your script (using Daily data though) after uncommenting Synchronize. If you could sufficiently explain what's not right, that might help.
QUOTE:
Does any mechanism to plot my new graph as a main graph on the pane exist here?

Sure, it's possible to create a custom chart style extension. For open source example, see below (authorized Wiki account req'd):

Home - Community ChartStyles
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).