ALGORITHM II: Difference between revisions

From MarketPawns
Jump to navigation Jump to search
mNo edit summary
m (Adding step)
Line 120: Line 120:
::::The program moves to step 4.
::::The program moves to step 4.
::::'''3.3.ext.2.3''' If t.5" is not found, the program moves to step 4.
::::'''3.3.ext.2.3''' If t.5" is not found, the program moves to step 4.
==='''Step IV: Searching for Potential Foundation Blocks.'''===
====Initial Check====
First, it is necessary to check for the presence of a fixed t.2. If it exists, it means we are in a branch for searching for alternative models.
::'''4.0.1.''' If t.2 is defined in the model, proceed to step 6.
::'''4.0.2.''' If t.2 is not defined, the program moves to step 4.1.
====Examination of Extremes====
On the preceding trend, extremes are checked sequentially from right to left (i.e., into the past) from t.3 (or from another analyzed bar in repeated applications of this step) according to the N1 bar rule (as a candidate for t.2). Each found candidate for t.2 is checked for the presence of a confirming extreme (which also serves as t.1) according to the following algorithm:
::'''4.1.0.''' An extreme candidate for t.2 is found.
::'''4.1.1.''' The point of the last intersection of the candidate's level with the price is found. In this case, the program looks for the absolute maximum (if t.2 is a minimum, i.e., t.2 is low) or the absolute minimum (if t.2 is a maximum, i.e., t.2 is high) in the segment from the last intersection of the t.2 level with the price to t.2.
:::'''4.1.1.1.''' Maximum/minimum not found. In this case, the program discards this candidate for t.2.
:::'''4.1.1.2.''' Maximum/minimum found. In this case, the potential t.2 is confirmed.
:::'''4.1.2.''' The program reaches the starting point of the chart.
:::'''4.1.3.''' The check reaches the boundary of the Depth of Search for t.1 for the model and none of the above events (4.1.1. or 4.1.2.) occurred.
The search for Foundation Blocks (i.e., points 1 and 2) continues until one of the events in steps 4.2. and 4.3. occurs.
::'''4.2.''' The check reaches the bar containing the (presumed) starting point of the preceding trend.
:::'''4.2.1.''' One or several pairs of potential t.2 and t.1 are found. The program moves to step 5.
:::'''4.2.2.''' No potential Foundation Blocks are found. In this case, the program looks for the next potential t.5 according to step 2.
::'''4.3.''' The check reaches the bar that intersects the level of the presumed point 4 of the considered model.
::=== Results ===
::As a result of the search for potential t.2 (i.e., upon the occurrence of 4.2. or 4.3.), two scenarios are possible:
:::'''4.2.1. / 4.3.1.''' One or more pairs of potential t.2 and t.1 are found (potential Foundation Blocks). The program moves to step 5.
:::'''4.2.2. / 4.3.2.''' No potential Foundation Blocks are found. In this case, the program looks for the next potential t.5 according to step 2.

Revision as of 18:27, 26 August 2023

This article is not finished

For an accurate understanding of the algorithm, you should get acquainted with UMG General Concepts.

Step I. Search For Point 3 of the External Attraction Model (EAM) and the Sarting Point of the Previous Trend.

1.1. The program looks for the first possible extreme, satisfying Single Bar Rule. Such an extreme is a candidate for potential point 3 ( potential t.3).
1.2. Next, the program checks the bars from right to left (i.e., in the past) from the bar containing the extreme candidate for point 3 to one of the following events:
1.2.1. Found the last intersection (breakthrough) point by the price level of the candidate for point 3.
In this case, the report displays:
PREVdata: FullDataPrev
The program proceeds to substep 1.3.
1.2.2. The program reached the starting point of the chart (i.e., the price did not intersect the level of point 3 after the starting point of the chart).
In this case, the report displays:
PREVdata: NoFullDataPrev
The program proceeds to substep 1.3.
1.2.1. The price checked 300 bars preceding point 3, but the level of step 3 did not intersect at this segment. The program looks for an absolute extreme (opposite to step 3) on the segment from the 300th bar before point 3 to point 3. The program proceeds to substep 1.3.
1.3. The program looks for an absolute extreme (opposite to point 3 extreme) on the segment:
- from the last intersection by the price level of the candidate for point 3 (inclusive) (if came from 1.2.1.), or :: - from the starting point of the chart (if came from 1.2.2.), or
- from 300 bars(if came from 1.2.3.)
to point 3 (excluding).
1.3.1. Absolute extreme found. The candidate for point 3 is confirmed; moreover, the found confirming extreme is the assumed (if coming from 1.2.2. or 1.2.3.) starting point of the preceding trend.
The program checks for the absence of extremes equal to point 3 between the assumed starting point of the previous trend and point 3.
1.3.1.1. If such an extreme is found, this candidate for point 3 is discarded, and this point 3 is discarded.
1.3.1.2. If such an extreme is not found, the program proceeds to step 2.
1.3.2. Absolute extreme not found. This point 3 is discarded.
Simultaneously with step 1, the program launches the search for the next potential point 3.

Step II. Search For Potentioal Points 5 and 4

The Orientation rule (N1 requirement) for Algorithm II is as follows:
 If point 3 is low, then the level of point 5 should be higher than point 3. 
 If point 3 is high, then the level of point 5 should be lower than point 3.

Search for Point 5. The bar following the bar of Point 3 (and in repeated applications of this step - the bar specified in this algorithm) is checked for not overcoming the level of point 3 (since N1 requirement for Algorithm II must be observed).

2.1. If the price has overcome the level of point 3, the program discards the considered step 3 (due to N1 requirement).
2.2. If N1 requirement is met for the analyzed bar, it is checked for compliance with N1 requirement as a potential point 5 (hereafter - point 5 or t.5).
2.2.1. If the analyzed bar is not an extreme according to N1 requirement (as a potential point 5), the program checks the next bar from the beginning of step 2.
2.2.2. If the analyzed bar is determined as an extreme according to N1 requirement (as a potential point 5), then this bar is checked for reaching (but not necessarily overcoming) the level of point 3. There are 2 options:
2.2.2.1. If the level of point 3 is reached, the program analyzes the next bar according to this step (i.e., from the beginning of step 2).
2.2.2.2. If the level of point 3 is not reached, the analyzed bar is a potential point 5, and the program moves to substep 2.3.
2.3. Search for Point 4. The program searches for a bar, which was the last to cross the level of the considered potential point 5. Let's denote this bar as lcb5 (line-crossing-bar-5). If lcb5 coincides with the bar of point 3, we denote the bar following lcb5 as look4. Otherwise, look4 = lcb5. The program searches for a bar with the maximum (if point 3 is low) or minimum (if point 3 is high) price in the interval from lcb5 to potential point 5. Then this bar is checked for being an extreme according to N1 requirement as a potential pont 4 (hereafter – point 4 or t.4). There are 2 options:
2.3.1. The bar is an absolute extreme (as a potential point 4). In this case, potential point 4 is found.
2.3.1.1. If step 2 has already been determined (this is possible when this step is triggered during the search for an alternative model), the program checks the line chart for extra points in the section from step 2 to step 4. There are 2 options:
2.3.1.1.A. If extra points are found, the program processes the next bar after potential point 5 according to step 2.
2.3.1.1.B. Extra intersections are not found; the program moves to substep 2.4.
2.3.1.2. If substep 2.3.1. is triggered during the search for the basic model, the program moves to substep 2.4.
2.3.2. The bar is not an absolute extreme (as a potential point 4). In this case, the program looks for another candidate for point 5 according to this step (i.e., according to step 2).
If the program has processed 50 bars in a row according to this step (step 2), and the program has not moved to another step of the algorithm, then this potential point 3 is discarded.
If there are 150 or more bars between potential point 3 and the analyzed bar, and potential points 4 and 5 are not found, then this potential point 3 is discarded.
2.4. Real-Time Verification of t.5
The potential t.5 bar is checked for the presence of bars between the analyzed bar and the potential t.4 bar, which contain price values more distant (or even equally distant) from the potential t.4 than the most distant from t.4 value of the analyzed bar. This is a check of the potential t.5 for beeing the potential absolute extreme. The following options are possible:
2.4.1. If the extreme is potentially absolute, the program proceeds to step 3.
2.4.2. If the extreme is not potentially absolute, the program checks the next bar starting from this step (i.e., step 2).

Step III. Confirmation of Point 4. Searching for Alternative t.5 and t.5"

The program checks whether the bar of potential t.5 has reached the level of t.4. Two scenarios are possible:

3.1. The Bar of Potential t.5 Has Reached t.4.
In this case:
The model is built through absolute t.5.
The t.5 bar confirms t.4. The presence of a bar confirming t.4 indicates that:
Point 4 is confirmed,
Point 5 is confirmed.
The program proceeds to sub-step 3.3 (since there is already possible to display the model through t.5 on the chart).
3.2. The Bar of Potential t.5 Has Not Reached t.4.
In this case, the program checks the next bar for reaching the level of t.4. The following options are possible:
3.2.1. The Considered Bar Reaches the Level of Potential t.4.
In this case:
The model is built through absolute t.5.
The considered bar confirms t.4. The presence of a bar confirming t.4 indicates that:
Point 4 is confirmed,
Point 5 is confirmed.
The program proceeds to sub-step 3.3.ext, but first goes through sub-step 3.3.
3.2.2. The Considered Bar Does Not Reach the Level of t.4.
In this case the program checks the next bar for overcoming the level of potential t.5. Two scenarios are possible:
3.2.2.1. If the t.5 level is overcome, the analyzed bar is considered as a new potential t.5. The program processes this bar according to step 2.
3.2.2.2. If the t.5 level is not overcome, the analyzed bar is checked for reaching the level of t.4 according to sub-step 3.2.
In parallel (i.e., an additional branch is created), the program proceeds to sub-step 3.3 (since there is already an option to display the model through t.5 on the chart). The model in this branch receives a "draw_flag" label.
3.3. Construction of the Trend Line (TL).
A Trend Line (TL) is constructed from t.3 to t.5. Each bar between t.3 and t.5 is checked for breaking the TL. Two scenarios are possible:
3.3.1.The Price Crosses the TL.
In this case, the TL through t.3 is not constructed. The program searches for a candidate for point 3' (hereafter - t.3'). T.3' is selected in such a way that the TL' (constructed from t.3' to t.5) is not crossed by the price in the 3-5 segment. Rule No.1 for t.3' is not applied. T.3' cannot belong to the same bar as t.4. Two scenarios are possible:
3.3.1.1. T.3' is found, this model is classified as built through t.3'. The program proceeds to step 4, or to sub-step 3.3.extended if coming from 3.2.
3.3.1.2. T.3' is not found. In this case, the program searches for new potential t.5 and t.4 according to step 2.
3.3.2. The Price Does Not Break the TL.
In this case, this model is classified as built through t.3 (absolute extreme). The program proceeds to step 4, or to sub-step 3.3.ext. if current algorithm line is coming from 3.2.
3.3.ext. Additional Trend Line Construction Through t.5".

If:

  • The t.5 bar does not exceed the range of t.4;
  • At the time of model calculation, the level of t.4 is confirmed, then this model is checked for the possibility of constructing an additional Trend Line (TL) through t.5". Note: If t.4 is not confirmed, this model should be recalculated upon the appearance of a bar that confirms it's t.4.

Definition: Point 5" Point 5" can lie in the segment between t.5 and the point confirming t.4. On this segment, a point is searched that meets the following requirements:

Rule for Selecting Point 5" High To the left of the bar containing t.5", the nearest high should be above the level of t.5. To the right of t.5", at least one nearest high should be below or equal to t.5. If the nearest high is equal to the level of t.5, then the next high should again be below or equal to the level of t.5, until at least one bar is strictly below the level of t.5. Rule for Selecting Point 5" Low To the left of the bar containing t.5", the nearest low should be below the level of the extreme. To the right of t.5", at least one nearest low should be above or equal to t.5. If the nearest low is equal to the level of t.5, then the next low should again be above or equal to the level of t.5, until at least one bar is strictly above the level of t.5. Special Cases for Point 5" Point 5" may belong to a bar that has broken the level of t.4 (but only the first of such bars). If the bar of potential t.5" breaks the level of calculated t.6 from t.5, then it is impossible to construct a TL through t.5" for this model (this model does not contain such a point).

3.3.ext.1. Additional TL Calculation
If a bar is found that fits the rule for selecting 5", an additional TL is calculated for the potential t.5" (hereafter TL"). This line is checked for the absence of breaks in the segment from t.3/3 to potential t.5".
3.3ext.1.a. If there is an intersection, the program moves to check the next bar as a potential t.5".
3.3ext.1.b If there is no intersection, the found bar is compared with the previous candidate for t.5" (if there was one in the previous iteration of the cycle). If the considered bar is closer to the level of t.4 than the candidate for t.5", then the considered bar becomes the new candidate for t.5".
The check of bars continues in a cycle until a bar confirming t.4 is reached. If a candidate for t.5 is found as a result of the check, the program moves to sub-step 3.3ext.1.1; otherwise, it moves to step 4.
3.3ext.1.1 If the analyzed model is built through t.3', a candidate for t.3" is sought in the segment t.3-t.3', through which such a line to t.5" can be built that will not have price intersections in the segment t.3-t.3".
3.3ext.1.1.1 If a candidate for t.3" is found, where there are no intersections, a check is made for the intersection of TL" by the bar following t.5".
3.3.ext.1.1.1.A If there are intersections, t.5" is declared canceled, and the next one is sought according to sub-step 3.3.ext.
3.3.ext.1.1.1.B Otherwise, the program moves to step 13.2.
3.3.ext.1.1.2 If a suitable t.3" is not found, a re-search for a candidate for t.5" is carried out according to sub-steps 3.3.ext., but in this case, if a candidate for t.5" was found, it becomes a canceled candidate for t.5". The new candidate must already be further from t.4 than the previously discarded ones.
3.3ext.1.2 If the analyzed model is built through t.3, a check is made for the intersection of TL by the bar following t.5".
3.3ext.1.2.A If there are intersections, t.5" is declared as canceled t.5', and the next one is sought according to sub-step 3.3.ext.
3.3ext.1.2.B If there are no intersections, the algorithm moves to step 13.2.
3.3.ext.2 TL is checked for price intersections in the segment between t.5 (inclusive) and potential t.5" (hereafter segment 5-5").
3.3.ext.2.1 If there is an intersection, then this 5" is filtered out. A re-search for a candidate for t.5" is carried out according to sub-steps 3.3.ext., but in this case, the new candidate must already be further from t.4 (in terms of time) than the previously discarded ones.
3.3.ext.2.2 If there are no intersections of TL" in the segment 5-5", then t.5" is found.
In this case, the report displays: EAM5" EAM5"
The program moves to step 4.
3.3.ext.2.3 If t.5" is not found, the program moves to step 4.

Step IV: Searching for Potential Foundation Blocks.

Initial Check

First, it is necessary to check for the presence of a fixed t.2. If it exists, it means we are in a branch for searching for alternative models.

4.0.1. If t.2 is defined in the model, proceed to step 6.
4.0.2. If t.2 is not defined, the program moves to step 4.1.

Examination of Extremes

On the preceding trend, extremes are checked sequentially from right to left (i.e., into the past) from t.3 (or from another analyzed bar in repeated applications of this step) according to the N1 bar rule (as a candidate for t.2). Each found candidate for t.2 is checked for the presence of a confirming extreme (which also serves as t.1) according to the following algorithm:

4.1.0. An extreme candidate for t.2 is found.
4.1.1. The point of the last intersection of the candidate's level with the price is found. In this case, the program looks for the absolute maximum (if t.2 is a minimum, i.e., t.2 is low) or the absolute minimum (if t.2 is a maximum, i.e., t.2 is high) in the segment from the last intersection of the t.2 level with the price to t.2.
4.1.1.1. Maximum/minimum not found. In this case, the program discards this candidate for t.2.
4.1.1.2. Maximum/minimum found. In this case, the potential t.2 is confirmed.
4.1.2. The program reaches the starting point of the chart.
4.1.3. The check reaches the boundary of the Depth of Search for t.1 for the model and none of the above events (4.1.1. or 4.1.2.) occurred.

The search for Foundation Blocks (i.e., points 1 and 2) continues until one of the events in steps 4.2. and 4.3. occurs.

4.2. The check reaches the bar containing the (presumed) starting point of the preceding trend.
4.2.1. One or several pairs of potential t.2 and t.1 are found. The program moves to step 5.
4.2.2. No potential Foundation Blocks are found. In this case, the program looks for the next potential t.5 according to step 2.
4.3. The check reaches the bar that intersects the level of the presumed point 4 of the considered model.
=== Results ===
As a result of the search for potential t.2 (i.e., upon the occurrence of 4.2. or 4.3.), two scenarios are possible:
4.2.1. / 4.3.1. One or more pairs of potential t.2 and t.1 are found (potential Foundation Blocks). The program moves to step 5.
4.2.2. / 4.3.2. No potential Foundation Blocks are found. In this case, the program looks for the next potential t.5 according to step 2.