Reputation: 1
I'm new in MQL. I want to make a custom indicator that will return current day's highest price in a 1 minute timeframe. If I write:
current_day_high= iHigh(0,PERIOD_D1, 0);
Will it return current days high price?
In an 1M timeframe it should be changing during the day until reaches the highest price and become static.
How I can check if my custom indicator returns the values I want. Is there a way to store indicators values to check the calculations?
Upvotes: 0
Views: 267
Reputation: 1403
The correct usage of iHigh is as follows.
double iHigh(
string symbol, // symbol
int timeframe, // timeframe
int shift // shift
);
Therefore you should be using
iHigh(NULL, PERIOD_D1, 0);
This will return the current days High
price.
You can store any values as variables. If you feel the need to check the high (and I'm not sure why you would need to), you could use iHigh()
with the current timeframe combined with iHighest()
.
Upvotes: 0