# Calculating the direction of the next candle

*Work with the indicator is performed only when on the last run the fast and slow lines of the ADXR indicator have the upper direction...
One of the most used indicators is midlines. A distinction is made between simple, weighted and exponential averages. These are indicators that follow the trend. If there is a trend, they work well (have a high probability). However, about 70% of time the price moves in a sideways channel. With this kind of work, the average lines give a lot of false signals (have a small probability).*

The proposed trading system uses exponential midlines (EMA). It is the only indicator in the system, which parameters depend on the considered time interval. In order to increase the information content of the indicator on a long time interval, it is more reasonable to choose short periods of the midlines (5/8/13/21). If we take long periods of 34/55/89, they will rarely give meaningful information. When using periods of 5/8/13 on a short time interval (1 hour, 15 minutes, 10 minutes, 5 minutes) you get more signals, but there are a lot of false signals. To increase the reliability of signals on a short time interval, the period of the averages is increased. For example, for 5-minute charts, the optimal periods are 8/13/21. The shorter the used time interval, the longer should be the period of the average lines.

## Algorithm of drawing midlines

When drawing the average line (for example, with a period of 5) we take the last five candlesticks (including the last one that closed), find the arithmetic mean of their closing prices, and this point characterizes the last candlestick that closed. Then the algorithm is repeated, but the calculation involves the last five candles without the first candle, and so on. Thus the construction of a simple average line is carried out. To improve the information content of the sample, the weighting coefficients are introduced (k1> k2> k3> k4> k5). If the coefficients are decreasing according to the linear law, then we obtain weighted simple average lines. If the ratios decrease according to the exponential law (when the candle closest to the current time is most significant), we obtain exponential weighted average lines (EMA). The proposed trading system uses periods of 1/5 /8 /13/21 when working on monthly (M), weekly (W) and daily (D) charts.

**The following designations for the middle lines are accepted:**

- black - 1 middle line (EMA);

- white - 5 middle line (EMA;

- blue - 8 middle line (EMA);

- yellow - 13 middle line (EMA);

- brown - 21 middle lines (EMA).

The following average lines 8/13/21 are responsible for the color of the body. Find five properties on the last run (if any) and by simple logical addition determined the expected direction of the indicator, and hence the price for the next candle. The length of the calculated candle using the average lines indicator is not possible. Other indicators are responsible for this, and we will talk to you about them later.

## Properties of moving averages that determine the color of a candle

**1. The position of the middle lines relative to each other on the last closed candle.**

- If the center line (13) is higher than the center line (8), the signal is lower work (see Fig. 3).

- If the center line (13) is lower than the center line (8), the top work signal (see Fig. 2)

- the middle line (21) strengthens or weakens these signals.

In the presence of an upper work signal, the middle line (21), being below this signal, strengthens it, being above this signal, weakens it.

If there is a lower work signal, the middle line (21), being below this signal, weakens it, being above this signal, strengthens it.

If the center line (13) is higher than the center line (8), and the center line (21) is between them, the lower work signal is attenuated (see Figure 4).

If the center line (13) is below the center line (8) and the center line (21) is between them, the upper work signal is attenuated (see Figure 5).

**2. Crossing the center line (8) and the center line (13) on the last run.**

The middle line (8) going upwards crosses the middle line (ё3) going upwards from below - the signal of the upper work (see Fig. 6).

The middle line (8) going upwards crosses the middle line (13) going upwards from top to bottom - the signal of the lower work (see Fig. 7).

The middle line (8) going downwards crosses the middle line (13) going downwards - the signal of the lower work (see Fig. 8 ).

The middle line (8) going downwards crosses the middle line (13) going downwards - the signal of the upper work (see Fig. 9).

The center line (21) strengthens or weakens this signal.

If there is an upper work signal, the middle line (21), being below this signal, strengthens it, being above this signal, weakens it.

If there is a lower work signal, the middle line (21), being below this signal, weakens it, being above this signal, strengthens it.

**3. Correspondence of the direction of the price line (average line (1), plotted on the closing candles) and the direction of the average EMA line (8) on the last run. **

When the price moves downward (the average line (1), built on the closes of the candles) (see Fig. 10a):

- if the middle line of the EMA (8) is pointing downwards, it is not informative;

- if the average EMA line (8) is directed upwards, then there appears the property of inconsistency of the price line movement and indicator, which has the direction of the movement of the indicator on the last run, i.e., upwards.

When the price moves upwards (the average line (1), built on the closes of the candles) (see Fig. 10B):

- if the average EMA line (8) is pointing upwards, it is uninformative;

- if the average EMA line (8) is directed downwards, there appears the property of inconsistency of the price line movement and the indicator, which has the direction according to the indicator movement on the last run, i.e. downwards.

**4. "Hard Schedule:**

- when calculating the day is the schedule of the week;

- when calculating the week is the schedule of the month;

- The month doesn't have a heavy schedule.

**5. External factors:**

1. price touches resistance/support lines;

2. Historical support/resistance levels;

3. Bollinger lines (trim lines);

4. Bollinger lines (overbought/oversold zones);

5. Fibonacci levels;

6. analysis candlesticks;

7. reversal figures on the price (triangle, flag, pennant, wedge, double top, double base);

8. fractal levels.

The decision on the fifth property is made when the signals from at least three of these instruments coincide.

## Example of calculation of the next candle by the average lines (EMA)

Let's analyze the data of the daily chart on 20.04.2004 (on Tuesday). The last closed candle is a black wave. We have the following picture on the average lines (EMA) on the last run:

21 Wed (?) > 13 Wed (?) > 8 Wed (?) > 1 Wed (?) > 5 Wed (?).

The following average lines (EMA) are responsible for the body - 8/13/21.

The symbols in Figure 11:

1 EMA middle line.

5 EMA middle line.

8 EMA middle line.

13 EMA middle line.

21 EMA middle line.

**Properties to determine the color of the body of the next candle:**

1) 21cp > 13cp > 8cp. - signal of strong lower work.

2) There is no midline (8) and midline (13) intersection.

3) On the last run, the average (price) line (1) goes up, the average line (8) goes down. There is a discrepancy between the price movement and the indicator movement on the last run. The middle line (8) appears to have a lower running property.

4) The "heavy chart" (week) for that day gave the lower trend (how to determine the weekly trend for that day is not considered in this example).

5) There are no external factors here.

**Bottom line:** The logical addition of the five properties gives a signal downwards, which means that the next candle will have a black scenario and the first tail of this candle will be upper (whether it will be or not, the calculation of the first tail will show).

**Properties for determining the top tail of the next candle on the last run:**

The middle line (8) above the middle line (5) is the signal of the lower work.

No midline (8) and midline (5) intersection - no property.

The middle line (1) goes up, the middle line (5) goes up - no property.

The middle line (1) goes up, the middle line (8) goes down - the signal of the lower work.

The middle line (1), going up, on the last run crosses the middle line (5), going up, from the bottom up - the signal of the upper work. But the middle line (1) closed in the neutral zone, in which all the received signals weaken, so instead of a strong signal upwards, we get a weak signal.

Logical addition gives **bottom job**It means that the next calculated black candle will be without the upper tail, and you can immediately look for the entry point downwards.

*Read more in issue 57 of ForTrader.org.*