I am going to attempt a pseudo-code version of what I posted. I hope this helps but please don't hesitate to let me know if I can take another approach. I believe this pseudo code will be useful if we do need to take another approach as a reference.
[FONT=Courier New] make a container to store the current bar's minimum[/FONT]
[FONT=Courier New][FONT=Courier New] make a container to store the current bar's minimum[/FONT]
Run a sub-program called OnBarUpdate. Everything
that is created inside this subprogram is destroyed.
This is why we made places to store stuff earlier.
Sub-program contents :
If this is the first tick of the bar, reset
our stored current minimum and maximum
If the current ask price is lower than the lowest
price in this bar so far, the current ask price
is now the current bar's minimum price
If the current bid price is higher than the
highest price in this bar so far, the current
bid price is now the current bar's maximum
price
Now you can write your own code here, and now
you know what the bid, ask, max, and min prices
are
[/FONT]

Comment