Download MetaTrader 5

Trend function

To add comments, please log in or register
Watch how to order a trading robot
Read the Rules before you post an order or execute it
How to order a trading robot and get the desired result
Develop a robot in no time
Write trade operations easily
121
Customer 2016.11.14 09:30 20 - 30 USD   from 2 to 4 day(s)

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.



Libraries, MQL4
Job completed in 2 days. Budget: 25.00 USD
2016.12.10
: very very nice client :)

Developer 2016.11.14 09:40
Published 1 code in Library
Jobs: 818 (61% personal)
Arbitration: 89 (completed in favor of the developer 30%, canceled in favor of the customer 39%)
Overdue: 230 (28%)

Developer 2016.11.14 14:18
Jobs: 482 (52% personal)
Arbitration: 44 (completed in favor of the developer 13%, canceled in favor of the customer 68%)
Overdue: 171 (35%)

Developer 2016.11.14 09:34
Jobs: 378 (30% personal)
Arbitration: 26 (completed in favor of the developer 3%, canceled in favor of the customer 38%)
Overdue: 91 (24%)

Developer 2016.11.15 11:46
Jobs: 71 (42% personal)
Arbitration: 33 (completed in favor of the developer 18%, canceled in favor of the customer 36%)
Overdue: 36 (50%)

Developer 2016.11.14 10:15
Jobs: 33 (27% personal)
Arbitration: 10 (completed in favor of the developer 20%, canceled in favor of the customer 20%)
Overdue: 11 (33%)
To add comments, please log in or register