Pip distance from moving average indicator

2020.01.06 指标

指定

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
开发者 1
2020.01.06
等级
5
(4)
项目
6
0%
仲裁
4
25% / 25%
逾期
1
17%
工作中
2
开发者 2
2020.01.06
等级
4.87
(116)
项目
137
41%
仲裁
30
7% / 77%
逾期
20
15%
空闲
3
开发者 3
2020.01.06
等级
5
(5)
项目
5
20%
仲裁
1
0% / 100%
逾期
0
空闲
4
开发者 4
2020.01.06
等级
4.67
(12)
项目
24
13%
仲裁
16
19% / 50%
逾期
14
58%
工作中
5
开发者 5
2020.01.06
等级
4.43
(7)
项目
11
18%
仲裁
7
14% / 57%
逾期
1
9%
已载入
6
开发者 6
2020.01.06
等级
5
(2)
项目
2
0%
仲裁
2
0% / 50%
逾期
0
已载入
7
开发者 7
2020.01.06
等级
5
(371)
项目
619
69%
仲裁
12
50% / 17%
逾期
209
34%
已载入
8
开发者 8
2020.01.06
等级
5
(65)
项目
85
27%
仲裁
10
0% / 90%
逾期
17
20%
工作中
9
开发者 9
2020.01.07
等级
4.85
(357)
项目
646
49%
仲裁
205
55% / 28%
逾期
138
21%
已载入

项目信息

预算
30+ USD
VAT (19%): 5.7 USD
总计: 35.7 USD
开发人员
27 USD