Disliked{quote} "People with very limit IQ use profanity to impress." --- prove it. Could be just another opinion or wrong study, and I don't accept it entirely but take a look at this. Did read nothing of what you typed after the phrase I marked yellow, you did show yourself enough.Ignored
"Btw, the answer turned out to be so simple! All that was needed to say was: 1) 1st calculated HA candle takes place for the 1st standard candle on the chart, 2) the value of open price for this HA candle is zero. That's it! Nothing more!"
Is flawed.
1) the value of open price for this HA candle is zero.
-- Nowhere in the code the value of open price can be zero.
-- The variable that is used can be initialized with zero. Subsequent code will assign a value to that variable.
-- Zero value will put the price value of (USD / EUR /JPY ) at 0.00.
-- What will the x value be to plot the starting point "Open[i]" of the new bar (HA candle or Standard candle) on the chart?
-- https://www.mql5.com/en/articles/1391: "division by zero or array out of range are critical errors and usually lead to application crash"
c. Add or subtract with zero does nothing
-- 5 + 0 = 5 or 5 - 0 = 5
2) 1st calculated HA candle takes place for the 1st standard candle on the chart
Nicholishen gave you the answer
"Dude, I already told you in the other thread. The earliest candle on the chart HA open = first bar open."
-- first bar = 1st standard candle
What the code does do is:
Obtain the price with
i = 0
-- if(open[0]<close[0]) ...........................
Why bother to explain further. You anyway only going to read only the first sentence.