| / | Forum |
|
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 Step-by-step instructions of how to organize data transfer from Matlab to MetaTrader 4 using DDE. |
|
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 ) ]; |
|
stone
2006.03.12 11:20
cleon: thanksHi, "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 ) ]; it also return 1. |
|
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. |