Confusing heiken ashi buffer numbers!

 

hi guys,

i saw 2 different heiken ashi buffer numbers  for 4 candle values while googling around 

how is that even possible!

and which one is correct and how can i find correct buffer numbers from heiken ashi or other indicators?....


tnX for help in advance


First Buffers: 0,4,2,3

double haOpen = iCustom(NULL, 0, "HEIKEN ASHI", 0, 0);
double haClose = iCustom(NULL, 0, "HEIKEN ASHI", 0, 4);
double haHigh = iCustom(NULL, 0, "HEIKEN ASHI", 0, 2);
double haLow = iCustom(NULL, 0, "HEIKEN ASHI", 0, 3);


Second Buffers: 2,3,1,0  

double  candleOpen =iCustom(NULL,0,"HEIKEN ASHI",2,0);
double  candleClose = iCustom(NULL,0,"HEIKEN ASHI",3,0);
double  candleLow =iCustom(NULL,0,"HEIKEN ASHI",1,0);
double  candleHigh = iCustom(NULL,0,"HEIKEN ASHI",0,0);
 
Amirfakhredin Ghanbari: i saw 2 different heiken ashi buffer numbers  for 4 candle values while googling around
  1. No you not. The first reads buffer index zero, for four different candles. The second reads four buffers for candle zero.

    Perhaps you should read the manual.
       How To Ask Questions The Smart Way. (2004)
          How To Interpret Answers.
             RTFM and STFW: How To Tell You've Seriously Screwed Up.

  2. Buffer zero/one is not the low/high of the HA candle. See № 3

  3. You should encapsulate your iCustom calls to make your code self-documenting.
              take candle color hekin ashi - MQL4 and MetaTrader 4 #8-10 or #1 (2018)

Reason: