Trend function

MQL4 资料库

工作已完成

执行时间2 天
员工反馈
very very nice client :)

指定

int Trend (int &candles, int &strenght)

 

The idea is to check if the upper timeframe trend agreed with the indicator on the current timeframe.

I need a function that returns 1 if the trend is positive, otherwise 0, moreover I need that the function can also write in the first parameter (candles) how many candles ago the trend started; in the second parameter, it has to write the strenght of the trend, to understand if is a strong trend and when the trend has started.

How to calculate the strength:Consider the % variation of currency value from the start of the trend.

Suppose that I received a signal in D1 that suggest me to go sell. Through this function I want to check if the trend of the upper timeframes, in this case W1 and MN 1, confirm me that going sell is ok, and also understand when the trend started and how much is its strength.

Thus the result should be the same as the image attached.



附加的文件:

JPG
trend.JPG
162.3 Kb

反馈

1
开发者 1
等级
(414)
项目
670
33%
仲裁
60
17% / 32%
逾期
113
17%
工作中
2
开发者 2
等级
(879)
项目
1392
67%
仲裁
117
32% / 42%
逾期
215
15%
工作中
3
开发者 3
等级
(28)
项目
47
23%
仲裁
13
31% / 15%
逾期
12
26%
空闲
4
开发者 4
等级
(564)
项目
933
47%
仲裁
302
59% / 25%
逾期
125
13%
已载入
5
开发者 5
等级
(91)
项目
144
38%
仲裁
67
15% / 48%
逾期
55
38%
空闲

项目信息

预算
20 - 30 USD
VAT (22%): 4.4 - 6.6 USD
总计: 24.4 - 36.6 USD
开发人员
18 - 27 USD
截止日期
 2  4 天