ALGORITHM I

From MarketPawns
Revision as of 02:00, 18 July 2023 by Admin (talk | contribs)
Jump to navigation Jump to search
The N1 rule (N1 requirement) for Algorithm I is as follows:
 If point 1 is low, then the level of point 3 should be equal to or higher than point 1. 
 If point 1 is high, then the level of point 3 should be equal to or lower than point 1.

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


1. Find Point 1. Search for a Confirming Extremum.

1.1. The program searches for the first possible extremum that satisfies N1 rule. This extremum is a candidate for point 1.
1.2. When a candidate for point 1 is found, all bars to the left (i.e., in the past) of the bar containing the candidate extremum are checked until one of the following events occurs:
1.2.1. The point of the last intersection of the price level with the candidate for point 1 is found [1]. In this case, the program searches for an absolute extremum that confirms point 1 from the intersection of the price level with the candidate for point 1 (inclusive) to the bar of point 1 (exclusive). There are two possibilities:
1.2.1.1. If the extremum is not found, the program searches for a new candidate for point 1.
1.2.1.2. If the extremum is found, the candidate for point 1 is confirmed. The program then checks for the absence of extremums equal to point 1 from the beginning of the preceding to point 1.
1.2.1.2.1. If such an extremum is found, this candidate for point 1 is discarded (the program continues to process other candidates for point 1).
1.2.1.2.2. If such an extremum is not found, the program proceeds to process the next bar after point 1 according to point 2 of the Algorithm.
1.2.2. The program has reached the starting point of the chart (i.e., after the starting point of the chart, the levels of points 1 and 2 have never intersected). The program searches for a confirming extremum from right to left to the starting point of the chart. The options are similar to the sub-items 1.2.1.1. and 1.2.1.2.
1.2.3. The program has checked 50 bars [2] preceding the bar of the potential point 1, and none of the above events have occurred. The program searches for a confirming extremum from right to left in the area of 50 bars before the potential point 1. The options are similar to the sub-items 1.2.1.1. and 1.2.1.2.

2. Searching for Points 3 and 2.

If the program returns to this step during the construction of an alternative model, this branch of the algorithm stops.

The bar being analyzed after point 1 (or in cases of repeated application of the step specified in the algorithm) is checked for non-exceedance of the level of point 1.

2.1. If the level of point 1 is exceeded, the program discards this point 1.
2.2. Searching for Point 3. If the level of point 1 is not exceeded, the bar being analyzed is checked by rule N1 as an extreme.
2.2.1. If this bar is not an extreme according to rule N1 (as a potential point 3)[3], the program checks the next bar in accordance with step 2.
2.2.2. If this bar is an extreme according to rule N1 (as a potential point 3), then
2.2.2.1. If this step (step 2) is applied again after confirmed candidates for point 3 have been found (i.e., such point 3, for which there is a point 2 between point 3 and point 1), but for one reason or another they were rejected, and the algorithm returned to the search for point 3, then the exceedance of the level of the previous candidate for point 3 by this extreme is checked.
2.2.2.1.A. If the check is not passed (i.e., if the level of the previous candidate for point 3 is not exceeded), then the program processes the next bar in accordance with this step (step 2) and further according to the algorithm.
2.2.2.1.B. If the check is passed, then the program proceeds to sub-step 2.2.2.2.
2.2.2.2. Searching for Point 2. The program searches for an absolute minimum (if point 1 and point 3 are high) or maximum (if point 1 and point 3 are low) in the range from point 1 to point 3 (hereinafter segment 1-3) as point 2 (hereinafter point 2). Then this bar is checked for "extremity" according to N1 rule. Two variants are possible [4]:
2.2.2.2.A. If the bar is an extreme, then this is a potential point 2, and the potential point 3 becomes a confirmed point 3. In this case, the program proceeds to step 3.
2.2.2.2.B. The bar is not an extreme. In this case, the program begins to search for another candidate for point 3, for which it returns to the beginning of step 2.

If the program has processed 50 bars [5] in a row in accordance with this step (step 2), and potential points 2 and 3 have not been found (i.e., the program has not yet moved to another step of the algorithm), then this potential point 1 is discarded.

If there are 150 or more bars [6] between the potential point 1 and the bar being analyzed, and the program has not yet moved to another step of the algorithm, this potential point 1 is discarded.

3. Building TL. Search for t.4

Step 3.1. Checking for Fragmentation of the Base: After finding candidates for points 1, 2, and 3, a check is performed for the fragmentation of the Base. This means that there should be no extremes, co-directed with T.1, between the levels of T.1 and T.3 (extremes that fragment the Base, hereinafter referred to as EFB).
Step 3.1.1: If such extremes are present, the program checks each EFB for the presence of a confirming counter-directed extreme on the section from the last intersection of the price level of the EFB to the EFB (analogous to the search for a confirming extreme of a potential T.1 in step 1.2.1). If the EFB does not have a confirming extreme, then such an EFB is no longer considered (i.e., if there are no EFBs with confirming extremes, then the check is passed). If there is at least 1 EFB with a confirming extreme, then:
- The Base is fragmented;
- The confirmed t.3 becomes a cancelled t.3;
The program searches for a new t.3, for which it processes the next bar after the bar of the last cancelled T.3 according to step 2 of the algorithm.
Step 3.1.2: If the check is successful and no EFBs are found (including if there are no confirmed EFBs), then the program proceeds to sub-step 3.2.


3.2. Building and Checking TL on the 1-3 Section
Determining the Section on Which t.3' Can Be Found
Searching for t.3'.
The parameters of the Trend Line passing through t.1 and t.3 (hereinafter TL) are calculated. TL is checked for breakthroughs on the 1-3 section.
3.2.1. TL is Broken
The bar of the confirmed t.3 is checked for breaking the level of t.2.
3.2.1.1. If the level of t.2 is broken by the bar of the confirmed t.3, the confirmed t.3 becomes a cancelled t.3. The program searches for a new t.3. For this, the bar that broke the level of t.2 is processed according to sub-step 3.4.
3.2.1.2. If the level of t.2 is not broken by the bar of the confirmed t.3, then the next bar is processed according to sub-step 3.2.3.
3.2.2. TL is Not Broken - the bar following the bar of the confirmed t.3 is processed according to sub-step 3.3.
3.2.3. Determining the Section on Which t.3' Can Be Found
The analyzed bar is checked for breaking the level of the confirmed t.3.
3.2.3.1. If the level of the confirmed t.3 is broken, the confirmed t.3 becomes a cancelled t.3. The program searches for a new t.3. For this, the bar that broke the level of the confirmed t.3 is processed according to step 2 and further according to the algorithm.
3.2.3.2. If the level of t.3 is not broken, the program checks the analyzed bar for breaking the level of t.2.
3.2.3.2.1. If the level of t.2 is not broken, the program analyzes the next bar according to sub-step 3.2.3.
3.2.3.2.2. Searching for t.3'.
If it breaks the level of t.2, then the program looks for such a point 3' (hereinafter t.3') through which a line can be drawn from t.1 to t.3', which will not contain extra touches by the price on the section from the bar of t.1 to the bar following the bar of t.3' (inclusive), and this line should not contain extra breakthroughs (not touches) by the price on the section to the bar that broke the level of t.2 (not inclusive).
3.2.3.2.2.A. If t.3' is found, then the TL is rebuilt through t.3' (i.e., TL is now the line from t.1 to t.3'), and the algorithm searches for a potential t.4, for which it processes the bar that broke the level of t.2 (but if the bar that broke the level of t.2 coincides with the bar of t.3', then the program immediately proceeds to process the next bar) according to sub-step 3.4.
3.2.3.2.2.B. If the point t.3' is not found, then the confirmed t.3 becomes a cancelled t.3. The program searches for a new t.3, for which it processes each previously unprocessed bar for the cancelled t.3 according to step 2 and further according to the algorithm. If between t.1 and the analyzed bar there are 150 or more bars, and the program has not yet moved to another step of the algorithm, this potential t.1 is discarded.
3.3. Checking TL on the Section After t.3.
The analyzed bar is checked for overcoming TL.
3.3.1. TL is not overcome - the analyzed bar is processed according to sub-step 3.4.
3.3.2. T Lis overcome. In this case, there are 2 options:
3.3.2.1. If between the analyzed bar (not inclusive) and the bar of t.3 (inclusive) the level of t.2 was not reached, the program performs a search for t.3', for which it moves to sub-step 3.2.3.
3.3.2.2. If between the analyzed bar (not inclusive) and the bar of t.3 (inclusive) the level of t.2 was reached, the program performs a search for a new candidate for t.3. For this, the analyzed bar is processed according to step 2 and further according to the algorithm.
Step 3.4: Searching for Potential or Alternative t.4
If the program is searching for t.4 and the analyzed bar is further from t.1 than 5 times the distance between t.1 and t.3, then this potential t.1 is discarded.
If the program is searching for an alternative t.4 and the analyzed bar is further from t.1 than 10 times the number of bars between t.1 and t.3, then the search for an alternative t.4 is terminated.
The analyzed bar is checked for being an extreme according to rule N1 (as a potential t.4).
Step 3.4.1: If the Bar is not an Extreme
The program checks the analyzed bar for breaking through (in this case, not touching) the LT.
Step 3.4.1.1: If the LT is not reached (not broken), then the program processes the next bar according to Step 3.4.
Step 3.4.1.2: If the LT is broken, then the analyzed bar is processed similarly to Step 3.3.2.
Step 3.4.2: If the Bar is an Extreme
This is potentially t.4, proceed to Step 3.5.

References

  1. High or low equal to high or low of t.1 is an intersection
  2. The depth of the search for the extremum confirming volume 1
  3. Here and further under the formulation (as a potential T.3) a reminder is implied that this extremum should be aligned with the potential T.1. (see the Rule of alternating extremes).
  4. As part of this particular check, it should be noted that bars T.1 and T.3 should not reach the level of T.2
  5. The range of continuous search is t.3 in one iteration for all models except EAM
  6. Maximum search range t3 for all models except EAM