|
The AutoSplitter algorithm organizes market data (30 minute bar data, including date, time, high, and low prices) into a series of profiles. Its principal objectives are to draw historical profiles and to handle real-time data. Where the latter is concerned, the algorithm looks at the current bar to determine if it belongs in the current Profile, or whether it represents the beginning of a new Profile.
A Profile consists of values essential to split a series of bars into groups of contiguous data. These values include:
Data |
Description |
Start Date |
The Start date for a profile |
Start Time |
The Start time for this profile |
End Date |
The end date for this profile |
End Time |
The end time, all bars after this date/time belong to the next profile |
Profile High |
The high price of all bars in this profile |
Profile Low |
The low price of all bars in this profile |
Profile Open |
The Open price of the first bar in the profile, may be missing |
Profile Close |
The Close price of the last bar in the profile, may be missing |
Profile Volume |
The accumulated volume of the bars in the profile |
Control Price |
Price computed after the profile has fully formed, see below |
Profile Flags |
Flags as to whether the profile has valid Volume, Open, and Close values |
Also Relevant to the split:
Minimum:
this parameter specifies the minimum size (number of bars of some time
unit) for each profile. Any profile formed will have at least this many
bars. The Minimum parameter must be greater than zero (a minPeriods value
of zero would be meaningless).
Periods to Compare:
After the number of bars in the currently developing profile has reached
the Minimum value, the Periods to Compare parameter specifies the number
of periods back from the most recent bar to consider to determine if a
new profile has formed, and the current profile is complete. If a new
bar extends the range (either up or down) of the previous Periods to Compare
bars, a new Profile has formed. If the current Profile contains at least
Minimum, but not yet Periods to Compare, then the Splitter uses only the
bars in the current Profile to calculate the high and low to compare against
the new bar high and low. If
the high price of the new bar is higher than the high, or the low is lower
than the low, of the bars being compared, then the new bar becomes the
first bar of a new Profile. A Periods to Compare value of zero is valid,
and indicates that the Splitter should always create a new profile after
including the number of bars specified by the Minimum parameter.
Minimum Increment:
The Minimum Increment value determines what is a valid price for the contract.
For instance, if the contract is priced in 100ths, but has a Minimum Increment
value of 5, only 0, 5, 10, 15, etc. would be valid prices for the contract.
For the Splitter algorithm, this value is only relevant when computing
the Control Price.
The splitter algorithm starts at the beginning of an array of bars,
and creates an array of Profile structures, which can be used to display
the bars grouped on the screen in Profiles, or to calculate studies for
other purposes. As indicated above, each bar is compared against the last
Periods to Compare bars in the current Profile (or if that number has
not been reached, to the other bars already in the profile), to determine
if a new high or low for the profile has occurred. A new high or low occurring
after Minimum indicates a new profile.
If a new profile has formed, the Control Price is computed and the current
Profile is added to the array of profile structures. The Control Price
is only computed after the completion of the bar following the last bar
in the profile. If, for instance, a new high is set at the beginning of
a period, but the bar is not complete, it is obvious that a new profile
has formed, but the Control Price would not be set until the new bar had
completed. This eliminates Control Price changes as the period completes.
A new Profile is created and initialized with the High, Low, and dates
and times of this first bar. If
the bar
has a valid Open value (determined by flags on each bar), the Profile
Open of the new Profile is set to the value of the Open of this first
bar, and the Profile Flags is set to indicate that the new Profile will
have Open and Close values. If the bar has valid Volume, the new Profile
Volume is set to the volume of the bar, and the flag is set to indicate
volume.
If there is no new high or low, then this bar is added to the bars of the current profile (by extending the End Date/End Time to include the new bar). The Profile High and Profile Low members are updated as needed by comparing the new bar high and low against the last Periods to Compare highs and lows. The Profile High and Profile Low ranges can only contract, since extension in either direction would indicate the start of a new Profile. If there are valid values for Volume, the volume of this bar is added to the cumulative Profile Volume, and if there is a valid Close, the Profile Close is updated to the Close of this bar.
Control Price Calculation
When Periods to Compare equals zero
In this case the control price is set to the average of the High and Low of the bars in the profile. The price should be computed using the Minimum Increment value so that the resulting integer is a valid price for the contract, i.e.
For example:
High = 8149,
Low = 8250,
Minimum Increment = 4
( 8149 + 8250 ) = 16399
16399 / (2 * 4) = 2049.875
2049.875 = 2050 (integral)
2050 * 4 = 8200
When Periods to Compare is nonzero
In this case the Control Price is set with respect to how the new bar broke the range of the previous bars to form the new profile.
If the new bar breaks the high range of the previous
Periods to Compare (a new high), the Control Price is the lesser of the
previous profile's High and the current bar's low.
If the new bar breaks the low range of the previous
Periods to Compare (a new low), the ControlPrice is the greater of the
previous profile's Low and the current bar's high.
If the new bar broke both the high and low range of the previous Periods to Compare (new high and low), the Control Price is computed as in the case where Periods to Compare equals zero.
©2008 Aspen Research Group, Ltd. All rights reserved. Terms of Use.