DYO: High and Low Between 2 Times
|
Mark on a chart the highest high and lowest low that occur between 2 times, such as between 8:30 and 11:00.


Line A is a Boolean flag that is True on the bar at the first time boundary, where the time is the value in the Number field. This 1st boundary is also marked with the gray Zone stripe. The flag is stored in Global Variable [1] for use by Lines B and C.
Lines B and C reset two private Global Variables [201] and [202] which hold the highest High or lowest Low values that are to be plotted. When the flag in GV[1] is True, the bar's High and Low values referenced in the Number field are written to Global Variables [201] and [202].
Line D and E test the boundaries for the time period of interest. The two time boundaries are in the Number fields.
Line F will test the flags from Line D and E and when the bar's time is outside of the time period, execution skips Lines G and H which update the highest High and lowest Low. Eexecution jumps down to Line I when outside of the time period.
Lines G and H update the highest High and lowest Low. These values are saved in private Global Variables [201] and [202] so they can be plotted by Lines I and J. For example, Line G compares a bar's High value referenced by the [$H] tag in the Number field with the current highest High in GV[201], and writes the higher value back in [201].
Lines I and J plot the highest High and the lowest Low values stored in the private Global Variables in [201] and [202].
This example can be downloaded as template: 2TimesHHLL
Last modified 1/14/09 12:33 PM
|