bars informations, anyone has knowledge of how to get it?

 

hi, I'm looking for someone who has knowledge on how to get the informations about the last closed bar in my chart. I have been trying to figure out witch one it with

count = IndicatorCounted()-1

or something like

count = Bars-1

count = iBars(Symbol(),Period_D1 )-1

or else

high = iHigh(Symbol(),Period_D1,1);

low = iLow(Symbol(),Period_D1,1);

I'm very confused about witch one to use so if someone can tell me what would be right to use for these high and low values it would be much appreciated

then

if anyone knows about this I would really love to know the high and low price of this last complete bar in my chart and use these values for my EA.

thank you for anyone who could possibly point me the right way to do it

 
liquidd:

hi, I'm looking for someone who has knowledge on how to get the informations about the last closed bar in my chart. I have been trying to figure out witch one it with


The last closed bar is bar number 1 . . .
 
RaptorUK:
The last closed bar is bar number 1 . . .


so the iHigh and Ilow I stated would be the right one? is it?
 
liquidd: so the iHigh and Ilow I stated would be the right one? is it?

Yes.... This is the very basic stuff. If you're going to program I'll recommend understanding the bar index.

https://www.mql5.com/en/articles/1475

 
liquidd: how to get the informations about the last closed bar in my chart.

high = iHigh(Symbol(),Period_D1,1);

low = iLow(Symbol(),Period_D1,1);

  1. The last close of your chart is Close[1]. The last high and low of your chart is High[1] and Low[1]. The last high and low of the D1 chart is what you posted. Not the same thing unless your chart happens to be the D1 chart.
  2. count = IndicatorCounted()-1 
    Indicator don't worry about any such things. then compute all bars on their current chart
    int count = indicatorCounted();
    if(count < LOOKBACK) count = LOOKBACK;
    for(int iBar = Bars - 1 - count; iBar >= 0; iBar--) Buffer[iBar] = ...;