Hi,
Say you have a day's worth of 5 minute price data in a column in Excel. For this example, say you have 81 data points, although the actual number of data points may vary in future applications.
For each row of price data, I'd like to find the first subsequent row pf price data that is N points above and current price in the row.
There would be three numbers per row: the price, and the row number of the subsequent bars that contain the +3 and -3 price bar.
So let's say N = 3 points. So if the first bar of data is at a price level of 1100, I'd like to figure out which subsequent row has 1103 and 997, if at all.
In the second row, the price is 1102. I'd then like to find the subsequent row that contains 1105 and 999.
This process would be repeated for the rows of price data.
The prices are not sorted (since they are the prices that occur during the course of the day), so the match and lookup functions aren't any help here.
A visual basic function would probably do the trick here:
FindRow( Array Reference, Price) = the row in the Array Reference that equals the specified Price.
Unfortunately, I haven't written a VBA function in over five years and forgotten how to do it.
Any suggestions?
Thanks.
-- M
Say you have a day's worth of 5 minute price data in a column in Excel. For this example, say you have 81 data points, although the actual number of data points may vary in future applications.
For each row of price data, I'd like to find the first subsequent row pf price data that is N points above and current price in the row.
There would be three numbers per row: the price, and the row number of the subsequent bars that contain the +3 and -3 price bar.
So let's say N = 3 points. So if the first bar of data is at a price level of 1100, I'd like to figure out which subsequent row has 1103 and 997, if at all.
In the second row, the price is 1102. I'd then like to find the subsequent row that contains 1105 and 999.
This process would be repeated for the rows of price data.
The prices are not sorted (since they are the prices that occur during the course of the day), so the match and lookup functions aren't any help here.
A visual basic function would probably do the trick here:
FindRow( Array Reference, Price) = the row in the Array Reference that equals the specified Price.
Unfortunately, I haven't written a VBA function in over five years and forgotten how to do it.
Any suggestions?
Thanks.
-- M
n