PL help

Questions about MultiCharts and user contributed studies.
2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

PL help

Postby 2haerim » 31 Aug 2008

I plot a 90 ticks and a 3 min bar chart for the same symbol.

Now, I would like to know how to count the number of 90 ticks bar per each 3 min bar.

Can someone help with this?


Thanks

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 31 Aug 2008

Code: Select all

input: ticks_per_bar(90);

var: number_of_tick_bars(0);

number_of_tick_bars = (UpTicks + DownTicks) / ticks_per_bar ;

plot1( number_of_tick_bars, "Number of Tick bars");
Hope this is what you are looking for... ;-)

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 31 Aug 2008

Can you explain your code please and how to use it please? For example, apply it to Data1 or Data2? How to set each charts' settings for Build Volume On?

There could be varialble number of 90 ticks bars between two 3 min bars.
I would like to know that number.

Thanks

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 01 Sep 2008

the code should be applied to the 3 min data series.
(the 90tick data series is not referenced. It does not have to be on the chart.)

This indicator will graph a histogram on a subchart. The histogram shows the number of tick bars per 3 min interval. (see attached example)

The code is self explanatory: it simply adds the upticks and downticks happened during the 3 min interval, and divide it by the number of ticks/bar (In your case, it is 90), and you get the number of 90tick bars per 3 minutes.

This code can be used in any minute chart interval, because it simply counts number of ticks happened during a bar. i.e if you apply this to a 3 min chart, you get number of 90tick bar per 3 minutes. if you apply this to a 5 min chart, you get number of 90tick bar per 5 minutes.
Attachments
number of tick bars.jpg
(103.81 KiB) Downloaded 698 times

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 01 Sep 2008

Got it. Thanks.

The chart's Build Volume On must be set to Tick Count, not Trade volume, right?

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Postby TJ » 01 Sep 2008

correct.



This Build Volume thing is an unfortunate legacy of TS...
I would much rather see MC change/improve the keywords once and for all... let Volume be volume, and let Ticks be ticks... and do away with the Build Volume routine.

But some old habits die hard.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 04 Sep 2008

Hi TJ,

We have to stick with this approach not to force our customers change their existing codes. However, we will consider the possibility of doing what you're suggesting.

Regards.


Return to “MultiCharts”