I use Low[], but the result is Open[], why?

 

I use Low[], but the result is Open[], why?

Anybody can help me with this?

 
Well, I dare say no one would be able to help you unless you provide more information. But I could be wrong, of course :)
 

Thanks. Below is my code:


I want the highest value of last_bars' High and lowest value of last_bars' Low.


range_high=High[0];

   for(i=1;i<last_bars;i++)

   {

      range_high=MathMax(range_high, High[i]);      

   }

     

   range_low=Low[0];

   for(i=1;i<last_bars;i++)

   {

      range_low=MathMin(range_low, Low[i]);      

   }

   Print(range_high," ",Low[0]," ",range_low);


The result of range_high is correct. But the result of range_low is not.

 

Low[0] and High[0] are referencing the current Bar, which hasn't completed yet. So, by definition, they will be changing all the time.


But more likely as you found out, if there is a trend, then one of them will be changing while the other is static. If the price is moving downwards for eg, then Low[0] will be changing all the time.

 
I tried it in my terminal
int start()
  {
int i;
double range_high=High[0];
   for(i=1;i<20;i++)
   {
      range_high=MathMax(range_high, High[i]); 
   }
double  range_low=Low[0];
   for(i=1;i<20;i++)
   {
      range_low=MathMin(range_low, Low[i]); 
   }
   Print(range_high," ",Low[0]," ",range_low); 
   return(0);
  }
Everything's working:
2009.02.11 23:44:45 test GBPUSD,M5: 1.4402 1.4369 1.4359
Reason: