Português

# Pip distance from moving average indicator

## Termos de Referência

Hello,

I need an indicator that draws two lines (or dots) on the chart, one above and one under the last price and moving average crossing.

Parameters:

- usual Moving average parameters(Period, Method, Apply to)

- numbers of candles we analize backwards (PARAM1)

- numbers of maximum distances to average (PARAM2)

- color for 2 lines

The distance of the lines from the last closed calndle will be calculated as follows:

1.) go back PARAM1 candles and calculate all maximal price distances for long and short (closing price above and under the moving average) from the moving average. A distance is defined as the maximal candle closing distance between the price and moving average between two price and moving average crosses. Please take a look at the attached prictures. The blue triangles show the price and moving average crossings. The white lines are the maximal distances between those crossings.

2.) Calcualte the average of the highest distances given by PARAM2

3.) draw a line above and one under the last price and moving average crossing for each following candle until the price and moving average crosses

4.) calculate and draw again, if the price crosses the moving average

Example:

Step 1.) we go back 1000(PARAM1) candles and analize the maximul distances and we get this distances:

- 10 pips

- 20 pips

- 30 pips

- 40 pips

- 50 pips

2.) if PARAM2 = 3, we take the 3 highest distance and build the simple average : (30 + 40 + 50) / 3 = 40

3.) Draw the two lines ( can be also dots like Parabolic SAR)

JPG
Distance.JPG
125.7 Kb

1
Desenvolvedor 1
2020.01.06
Classificação
5
(4)
Projetos
6
0%
Arbitragem
5
20% / 20%
1
17%
Trabalhando
2
Desenvolvedor 2
2020.01.06
Classificação
4.87
(116)
Projetos
137
41%
Arbitragem
30
7% / 77%
20
15%
Livre
3
Desenvolvedor 3
2020.01.06
Classificação
5
(5)
Projetos
5
20%
Arbitragem
1
0% / 100%
0
Livre
4
Desenvolvedor 4
2020.01.06
Classificação
4.71
(14)
Projetos
26
12%
Arbitragem
16
19% / 50%
15
58%
5
Desenvolvedor 5
2020.01.06
Classificação
4.43
(7)
Projetos
11
18%
Arbitragem
7
14% / 57%
1
9%
6
Desenvolvedor 6
2020.01.06
Classificação
5
(3)
Projetos
3
33%
Arbitragem
2
0% / 50%
0
7
Desenvolvedor 7
2020.01.06
Classificação
5
(373)
Projetos
621
69%
Arbitragem
12
50% / 17%
209
34%
8
Desenvolvedor 8
2020.01.06
Classificação
5
(66)
Projetos
86
27%
Arbitragem
10
0% / 90%
17
20%
Trabalhando
9
Desenvolvedor 9
2020.01.07
Classificação
4.85
(359)
Projetos
648
49%
Arbitragem
208
55% / 28%