P123

The installation of the Technical Analysis Package is required in order to access this indicator.

Description

The goal of the P123 indicator is to automatically detect a 1-2-3 pattern.

The following features make it stand out:

Innovative recognition of 4 different trend sizes

It recognizes points 1, 2, and 3 at the bar

Recognition of a trend continuation in the same direction as a trend break

Completely automatic adjustment of the search algorithm for all possible market conditions (no additional settings/inputs required)

Adaptive workflow, adjusting to any volatility fluctuations

Clear overview while simultaneously displaying the various trend sizes

Can be implemented within the Signal Builder and TradersYard X Script

The trend sizes are defined as follows:

T0 = large trend

T1 = medium-sized trend

T2 = small trend

T3 = smallest trend size

The smallest trend size (T3) cannot be detected on all trading instruments. Point 2 is often situated at the high of a bar, and point 3 at the low of the same bar. Depending on the timeframe and fluctuation range, T0 and T1 can be fused into one.

The indicator determines the selected timeframe of the chart and then labels all trends and trend sizes accordingly. When there is low volatility, trend recognition is more sensitive, and vice versa for higher volatility. The P123’s adaptive methods make for a balanced recognition of trend sizes.

Important tip:

In some cases, the large trend (T0) cannot be seen with the naked eye, which may be due to the fact that not enough candles are visible within the chart. A minimum of 500 candles should be loaded to ensure this is not the case.

Interpretation

Trading signals often form at points 2 & 3: at point 3 as entry signals into a correction phase within a confirmed trend, and at point 2 as a sub-trend in the trend direction of the superior trade. The definition of a trend at points 1 to 3 can be read in "Das große Buch der Markttechnik" by Michael Voigt (German only).

Visualization in the chart

The parameter input settings define which trend sizes are shown in the chart and whether or not they are connected by a line.

For the default settings, the trend T2 is enabled by default.

The depiction in the chart may change with the changing market movements. If the market moves below the last point 3 and breaks the uptrend, the point is marked with a “3?”. The newly created low becomes the new point 2 and the last point 2 becomes point 1.

The parameter settings are not relevant for the display in the chart and are primarily used for the Signal Builder.

The depiction in the chart is primarily influenced by the settings “Display 123” and “Display Lines”.

The settings highlighted in yellow have no influence on the chart. No changes need to be made.

Usage in TradersYard X Script

When using P123 in TradersYard X Script, multiple public variables are available.

A notation such as [barsAgo] is not available for this. Parameter occurrences are used in the following manner:

P123(int trendSize). ... <<a public variable, see below>>

P123(int trendSize, int occurrence). ...

                  false = no confirmed trend (phases 1 and 2)                                                                                        |

| LastPoint | last point of a trend, 1, 2 or 3 | | LastPointPrice | outputs the price value of the last market point | | LastPointDateTime | outputs the date and time of the last market point | | P1Price | outputs the value of the last point 1 | | P1DateTime | outputs the value and date/time of the last point 1 | | P2Price | outputs the value of the last point 2 | | P2DateTime | outputs the time and date of point 2 | | TempP3Price | putputs the value of the temporary point “3?” | | TempP3DateTime | outputs the time and date of the temporary point “3?” | | ValidP3Price | outputs the value of the last point 3. This is used as a stop placement. When this point is breached, a trend change is confirmed | | ValidP3DateTime | outputs the date and time for the last valid point 3 |

Parameters

trendsize: trend size from 0 .. 3

occurrence the occurrences of the youngest to the oldest point

Example

private void PrintOutTrendProperties(int trendSize)
{
  // Reverse order of prints fills output window in correct order
  Print("");
  Print("valid P3 date: " + P123(trendSize).ValidP3DateTime);
  Print("valid P3 price: " + P123(trendSize).ValidP3Price);
  Print("temp P3 date: " + P123(trendSize).TempP3DateTime);
  Print("temp P3 price: " + P123(trendSize).TempP3Price);
  Print("P2 date: " + P123(trendSize).P2DateTime);
  Print("P2 price: " + P123(trendSize).P2Price);
  Print("P1 date: " + P123(trendSize).P1DateTime);
  Print("P1 price: " + P123(trendSize).P1Price);
  Print("last point date: " + P123(trendSize).LastPointDateTime);
  Print("last point price: " + P123(trendSize).LastPointPrice);
  Print("last point: " + P123(trendSize).LastPoint);
  Print("is trend valid: " + P123(trendSize).IsTrendValid);
  Print("trend direction: " + P123(trendSize).TrendDirection);
}

Utilization within the Signal Builder

All public variables are available to you inside the Signal Builder as data series; they can be found under „Series & Output Values“. The name has an underscore ("_") suffix in order to differentiate it.

The parameters “trendSize” and “occurrence” can be found within the Signal Builder.

P123Pro

The parameter TrendSize can be found under the parameter settings (see figure). It is only intended to be used within the Signal Builder. This parameter is not relevant for display in the chart. The display is only controlled by the following settings: "Display 123" and "Display Lines".

You can see in the respectful description fields for each parameter to which extend the particular parameters may influence the chart or Signal Builder as well as TradersYard X Script.

Usage in the TradersYard X Script

For the TradersYard X Script purposes, several data series of the same type is doubled. For each of these data series the common notation with ...[barsAgo] can be used.

Parameters

Examples

private void PrintOutTrendProperties(int trendSize)
private void PrintOutTrendProperties(int trendSize)
{
    // revers order of prints fills output window in correct order
    Print("");
    Print("IsP21: " +  P123Pro(trendSize).IsP21[0]);
    Print("valid P3 date: " +  P123Pro(trendSize).ValidP3DateTime[0]);
    Print("valid P3 price: " +  P123Pro(trendSize).ValidP3Price[0]);
    Print("temp P3 date: " +  P123Pro(trendSize).TempP3DateTime[0]);
    Print("temp P3 price: " +  P123Pro(trendSize).TempP3Price[0]);
    Print("P2 date: " +  P123Pro(trendSize).P2DateTime[0]);
    Print("P2 price: " +  P123Pro(trendSize).P2Price[0]);
    Print("P1 date: " +  P123Pro(trendSize).P1DateTime[0]);
    Print("P1 price: " +  P123Pro(trendSize).P1Price[0]);
    Print("last point date: " +  P123Pro(trendSize).LastPointDateTime[0]);
    Print("last point price: " +  P123Pro(trendSize).LastPointPrice[0]);
    Print("last point: " +  P123Pro(trendSize).LastPoint[0]);
    Print("Is trend valid: " +  P123Pro(trendSize).IsTrendValid[0]);
    Print("Trend direction: " +  P123Pro(trendSize).TrendDirection[0]);
    Print("P2Breakout: " +  P123Pro(trendSize).P2Breakout[0]);
    Print("Extended Information: " +  P123Pro(trendSize).LastPointExtInfo[0]);
}

Usage in the Signal Builder

All data series (excluding the DateTime series) are available in the Signal Builder under the "Series & Output Values".

Logical variables (true and false) are replaced by the numbers 1 and 0. The "TrendSize" parameter is available in the Signal Builder as well. The description you will find below.

Examples

Inquiry whether the currently active in the chart middle trend is a downtrend: P123Pro(Close, 1).TrendDirection[0] - Inh. TimeFrame == 1

Inquiry whether the latest point of the currently active in the chart smallest trend is a Point2: P123Pro(Close, 3).LastPoint[0] - Inh. TimeFrame == 2

Inquiry whether the latest bar under the valid point 3 (not the 3?) of the small trend has been closed: P123Pro(Close, 2).isTrendValid[0] - Inh. TimeFrame == 1 AND (meaning new line) Close[0] - Inh. TimeFrame < P123Pro(Close, 2).ValidP3Price[0] - Inh. TimeFrame

Last updated