In the haDiff.lua-file (post of Dec 19, 2013) I fixed a bug calculating the Heikin Ashi open value. From the very beginning the open value is calculated based on the previous Heikin Ashi open value, which doesn't exists in the first period. Comparing the source code of FXCM Trading Station's built-in Heikin Ashi indicator I added an if-survey in the update-function:
- Code: Select all
if period == first then
open[period] = ( source.open[period-1] + source.close[period-1] ) / 2;
else
open[period] = ( open[period-1] + close[period-1] ) / 2;
end
The revised version can be downloaded here:
Chris