Code Your Own Rising Three Methods Candle Pattern Recognition Indicator.

Here is an example of an .mq4 code for an indicator that can find a Rising Three Methods candle pattern within a chart.

This code provides a basic framework for detecting Rising Three Methods candle patterns and showing them on a trading chart. It is important to thoroughly test and verify this custom indicator before using it in live trading.

You are welcome to modify and customized the below example to fit your specific trading strategy.

//|                                       Rising-3-Methods-Finder.mq4|
//|                                        Copyright © 2023, Richpips|
//|                                |

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 DodgerBlue
#property indicator_color2 Red

extern int period = 14;

double UpperBuffer[];
double LowerBuffer[];

int init() {
    SetIndexBuffer(0, UpperBuffer, INDICATOR_DATA);
    SetIndexBuffer(1, LowerBuffer, INDICATOR_DATA);
    SetIndexStyle(0, DRAW_LINE);
    SetIndexStyle(1, DRAW_LINE);
    SetIndexLabel(0, "UpperLine");
    SetIndexLabel(1, "LowerLine");
    return (0);

int start() {
    int counted_bars = IndicatorCounted();
    int limit = Bars - counted_bars;
    int i, j;

    for (i = limit; i >= 0; i--) {
        double high1 = High[i+1];
        double high2 = High[i+2];
        double high3 = High[i+3];
        double low1 = Low[i+1];
        double low2 = Low[i+2];
        double low3 = Low[i+3];

        bool bullish_engulfing = (Close[i+1] > Open[i+1]) && (Open[i] > Close[i+1]) && (Close[i] > Open[i]) && (Close[i] > Open[i+1]);
        bool is_rising = (high1 > high2) && (high2 > high3) && (low1 > low2) && (low2 > low3);
        bool is_within = (high1 > high3) && (low1 < low3);

        if (bullish_engulfing && is_rising && is_within) {
            UpperBuffer[i] = high1;
            LowerBuffer[i] = low3;
            for (j = i+1; j <= i+3; j++) {
                UpperBuffer[j] = high1;
                LowerBuffer[j] = low3;
        } else {
            UpperBuffer[i] = 0;
            LowerBuffer[i] = 0;

    return (0);

The indicator works by scanning the price data for a pattern that meets the conditions of a Rising Three Methods candle pattern. The conditions are:

  1. The first candle is a long bullish candlestick.
  2. The next three candlesticks are small bearish candlesticks that stay within the high and low range of the first candlestick.
  3. The final candle is another long bullish candlestick that closes above the high of the first candlestick.

When the indicator finds a pattern that meets these conditions, it draws two lines on the chart to highlight the high and low range of the pattern. The upper line is colored blue and represents the high range of the pattern, while the lower line is colored red and represents the low range of the pattern.

Traders can use this indicator to identify potential buying opportunities when the pattern appears. However, as mentioned earlier, it’s important to thoroughly test any trading strategy before using it in a live trading environment.