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
PL help
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
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");
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
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.
(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
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
- Marina Pashkova
- Posts: 2758
- Joined: 27 Jul 2007