MQL4 - automated forex trading   /  

Forum

How to use the Highest Function?

Back to topics list To post a new topic, please log in or register

avatar
2
stone 2006.03.11 17:35 
i want to get the highest price in the last four hours.

i use the higest function in my codes:"BuyH=Highest(NULL,PERIOD_H4,MODE_HIGH, 1,1);"

but it always return BuyH is 1?

May someone can help me? thanks.
Interaction between MetaTrader 4 and Matlab via DDE

Interaction between MetaTrader 4 and Matlab via DDE

Step-by-step instructions of how to organize data transfer from Matlab to MetaTrader 4 using DDE.


avatar
17
cleon 2006.03.11 20:49 
Hi,

"Highest" will return the number of the higher bar, plus you were using (.... 1, 1) and that means the highest bar between bar 1 and 1, what you want to know is the highest bar 1 to 4, so you need to change the code to (... 4, 1).

Try this: BuyH = High[ Highest( NULL, PERIOD_H4, MODE_HIGH, 4, 1 ) ];

avatar
2
stone 2006.03.12 11:20 
cleon:
Hi,

"Highest" will return the number of the higher bar, plus you were using (.... 1, 1) and that means the highest bar between bar 1 and 1, what you want to know is the highest bar 1 to 4, so you need to change the code to (... 4, 1).

Try this: BuyH = High[ Highest( NULL, PERIOD_H4, MODE_HIGH, 4, 1 ) ];
thanks

it also return 1.

avatar
17
cleon 2006.03.13 03:53 
Hi,

Try to declare BuyH as a double. I'm pretty sure that BuyH = High[ Highest( NULL, PERIOD_H4, MODE_HIGH, 4, 1 ) ]; doesn't return 1, the problem must be somewhere else.
Back to topics list  

To add comments, please log in or register