Simple iHighest Function in Line Indicator

 

Hello,

my problem is, that the iHigh function works fine for the horizontol line, but if i try to use the iHighest function it dont works, what is my fault?

#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Orange
#property indicator_color2 Orange

//External variables
extern double Sessionstart = 3;
extern double Sessionend = 7;


//Buffers
double Rangehigh[];
double Rangelow[];


//Init
int init()
   {
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,Rangehigh);
   SetIndexLabel(0,"Rangehigh");
   
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,Rangelow);
   SetIndexLabel(1,"Rangelow");
   

   
   return(0);
   }
   
   //Start
   int start()
      {
       
         
         int CalculateBars = 240;
         
         for(int Count = CalculateBars; Count >= 0; Count--)
            {
              Rangehigh[Count] = iHighest(NULL,PERIOD_H1,MODE_HIGH,30,1);
                           
              Rangelow[Count] = iLow(NULL,PERIOD_H1,0);
            
   
             }
             
           return(0);
       }
   

 

Don't mix up iHigh (=high of a bar) and iHighest (array index (shift) of the highest high of ...

Same with low!

 
gooly:

Don't mix up iHigh (=high of a bar) and iHighest (array index (shift) of the highest high of ...

Same with low!

I know what they do, my proble is that iHighest dont works in this indicator, on the chart is nothing. Just the iHigh Function works (or iLow)
 
Fx90:
I know what they do, my proble is that iHighest dont works in this indicator, on the chart is nothing. Just the iHigh Function works (or iLow)

You obviously don't know what they do!

iHighest does not return the high of a range, as gooly has already told you. 

 

thx now i understand what ya saying. I think i have worked too much with excel. it was my memory that this function would do this. in Excel it is the function "Max(defer area)". I wanted to defer the start of the period and then draw the line for a specific period lenth.

nice weekend

 
GumRai: You obviously don't know what they do!
Fx90: you obviously don't.
Rangehigh[Count] = iHighest(NULL,PERIOD_H1,MODE_HIGH,30,1); = 15.00000
                           
Rangelow[Count] = iLow(NULL,PERIOD_H1,0);                   =  1.12345

Now look at the example from iLowest - MQL4 Documentation (iHighest has a pair of typos)
  double val;
//--- calculating the lowest value on the 10 consequtive bars in the range
//--- from the 10th to the 19th index inclusive on the current chart
   int val_index=iLowest(NULL,0,MODE_LOW,10,10);
   if(val_index!=-1) val=Low[val_index];
 
WHRoeder:
GumRai: You obviously don't know what they do!
Fx90: you obviously don't.
Now look at the example from iLowest - MQL4 Documentation (iHighest has a pair of typos)
Sorry my english isnt the best at all.. It means, that you search with iHighest the (int) number of the candle, which is the lowest of the last 10 periods? and with the iHigh function you search for the (double) low?
 

possible way of usage:

double hiHi = iHigh(NULL,0, iHighest(NULL,0, ..));

it's all in the reference!

Reason: