iHigh(Symbol(),PERIOD_D1,0) is giving me Highest close

To add comments, please log in or register
Bwalya Tambule
590
Bwalya Tambule  

I am having the above problem.

I have coded iHigh(Symbol(),PERIOD_D1,0) in order to have todays highest price. 

But instead the display on the chart of the result of code shows it is giving the highest close.

This could be an empty 4 problem

Keith Watford
Moderator
20312
Keith Watford  
Bwalya Tambule:

I am having the above problem.

I have coded iHigh(Symbol(),PERIOD_D1,0) in order to have todays highest price. 

But instead the display on the chart of the result of code shows it is giving the highest close.

This could be an empty 4 problem

Highest close of what?

William Roeder
20207
William Roeder  
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors before accessing prices.
          Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum
Bwalya Tambule
590
Bwalya Tambule  
Keith Watford:

Highest close of what?

close of Hour Candle.
Bwalya Tambule
590
Bwalya Tambule  

I found a way around it. The EA is using Hr 1 trading time frame.

So I got Hr1 bar shift at days open and then highest Hr bars from then on.

Works fine

Marco vd Heijden
Moderator
12666
Marco vd Heijden  

You can also check out

iHighest(....
Bwalya Tambule
590
Bwalya Tambule  
Marco vd Heijden:

You can also check out

below is code of what I did.

//
      double TodaysHigh()
   {
      int HighBarH1 = iHighest(Symbol(), PERIOD_H1,MODE_HIGH,Day0Bar(),0);

       return(iHigh(Symbol(),PERIOD_H1,HighBarH1) );
    }   
//
      double TodaysLow()
   {
      int LowBarH1 = iLowest(Symbol(), PERIOD_H1,MODE_LOW,Day0Bar(),0);
       return(iLow(Symbol(),PERIOD_H1,LowBarH1) );
    }   

To add comments, please log in or register