• Get access

# How to use the Highest Function?

8

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.
47

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 ) ];
8

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.
47

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.