Hi All,

I have a 50,000 bar DB. When I plot BarIndex() over the following
intervals, these are the last values of BarIndex()...

1 min:   49,999
2 min:   25,356
3 min:   16,953
5 min:   10,197
10 min:   5,109
15 min:   3,414

Now, what I'm trying to do is manually (via AFL) convert from a given
BarIndex() value in one interval into another. At the moment I can do
that via the DateTime() of the given BarIndex(), using something
similar to the following...

New_BarIndex = LastValue(ValueWhen( Old_dt >=DateTime(), BarIndex() )));

Where Old_dt is the DateTime of the BarIndex value of the other interval.

This is great, but, sadly can require a lot of bars back to calculate
correctly, depending on how far back in the array the condition equals
true (and using unneccessary bars back slows down other complex code
I'm using).

I'm thinking there must be a much easier, cruder, way to convert from
a BarIndex() value in one interval into another.

Lets say I want to convert from a BarIndex() value of 19,408 in a 1
min interval into a 2 min or 3 min interval. Simple division...? I
ask, because clearly from the BarIndex() values I posted above, they
don't seem entirely linear in relationship... i.e. 25,356 is not 49,999/2.

Help & suggestions much apprciated.


Reply via email to