[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Converting from a specific BarIndex() in one interval to another



PureBytes Links

Trading Reference Links

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.



------------------------------------

**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

*********************
TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com
*********************

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

For other support material please check also:
http://www.amibroker.com/support.html

*********************************
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/