• Get access

How to use the Highest Function?

To add comments, please log in or register
stone
8
stone  
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.
cleon
47
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 ) ];
stone
8
stone  
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.
cleon
47
cleon  
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.
To add comments, please log in or register