Pattern DejaVu MT4 demo
This indicator predicts the nearest candles of the chart based on the search of up to three best coincided patterns (a sequence of candles of a given length) in the history of the current instrument of the current timeframe.
The found patterns are aligned with the current pattern at the opening price of the current (last) candle. The predicted candles are candles following immediately for patterns found in history.
Pattern search is performed once every time a new candle of the current timeframe opens. The indicator is not redrawn during the formation of a candle.
The coincidence error (in points) and the time of the found pattern are displayed in the lower right corner of the chart in the corresponding color. The coincidence error is calculated as the square root of the averaged sum of squared deviations of all OHLC prices of all candles in the pattern.
The indicator can be useful for predicting the market behavior and making decisions on trading operations.
For the indicator to find the most closely coincided patterns, it is necessary to provide the greatest possible depth of candles history.
- Pattern length - pattern length (positive integer value), i.e. the number of coincided candles of the desired pattern.
- Count of predicted candles - the number of predicted candles (positive integer value).
- Search for patterns - enumeration type parameter with the values one_best_coincided, two_best_coincided, three_best_coincided, which allows setting the number of the best coincided patterns to be searched in history (up to three).
- Visualization mode of prediction - enumeration type parameter with the values conventional_candles_only, generalizing_candle_only, conventional_and_generalizing_candles, which allows setting a visualization mode of prediction in the form of conventional candles only, of generalizing candle only (for Count of predicted candles > 1) or of conventional and generalizing candles at the same time (see screenshots below).
- Show patterns - boolean parameter (true/false), indicating the need to display the found patterns.
- History depth to search patterns (0 - all available) - history depth (the number of last candles) to search for patterns. If the parameter is set to 0, then all available history of candles is used. Keep in mind that increasing the history depth increases the time of finding patterns.
- The group of parameters Settings of candle styles that determine the appearances of conventional and generalizing candles for the three found patterns (the candle size and the color of the bullish and bearish candles). By default, bullish candles are displayed in lighter tones relative to the colors of bearish candles. The candle sizes used to plot all three patterns are set to different values (1, 2, 3) to display the full shape of candles of all three patterns (see the screenshots).
- The buffers 8 - 11 are used for plotting the found best coincided pattern with the least error of coincidence with the current pattern.
- The buffers 4 - 7 are used for plotting the second best coincided pattern with the next lowest error of coincidence with the current pattern.
- The buffers 0 - 3 are used for plotting the third best coincided pattern with the highest error of coincidence with the current pattern of the three.
The buffers with even numbers are used for plotting bearish candles, the buffers with odd numbers are used for plotting bullish candles.