Wrong results in indicator value (Heiken Ashi and iMACD)

 

Hi All,


I am a newbi so please be patient,


I have been trying to get the colour of a Heiken Ashi candle and have it working up to a point. The trouble is that I dont get enough candles of the correct colour. What I did was to write the indicator values for a set of candles out to a file and I find that one is missing, yet on the chart it appears. Hope someone can help and point me in the right direction to solve this issue.


Strategy Tester Setup

Expert Advisor: Test_Heiken_Ashi

Symbol: GBPUSD

Model: Every Tick

Use Date: 1.9.2009 to 2.10.2009

Period M15



Heiken Ashi Chart

File Export Data

2009.10.01 20:15:00 1.5946 1.5929 1.594325 1.5938 Red 1
2009.10.01 20:30:00 1.594 1.5952 1.594063 1.594475 Blue 3
2009.10.01 20:45:00 1.594269 1.5962 1.594269 1.595 Blue 2
2009.10.01 21:00:00 1.5944 1.5952 1.594634 1.594975 Blue 1
2009.10.01 21:15:00 1.5954 1.5935 1.594805 1.59455
Red 11
2009.10.01 21:30:00 1.5955 1.5941 1.594677 1.594675
Red 10
2009.10.01 21:45:00 1.5947 1.5933 1.594676 1.59395 Red 9
2009.10.01 22:00:00 1.594313 1.593 1.594313 1.5937 Red 8
2009.10.01 22:15:00 1.5941 1.5927 1.594007 1.59345 Red 7
2009.10.01 22:30:00 1.593728 1.5926 1.593728 1.59275 Red 6
2009.10.01 22:45:00 1.5935 1.5912 1.593239 1.592325 Red 5
2009.10.01 23:00:00 1.592782 1.591 1.592782 1.591725 Red 4
2009.10.01 23:15:00 1.5924 1.5916 1.592254 1.59185 Red 3
2009.10.01 23:30:00 1.5921 1.5915 1.592052 1.591775 Red 2
2009.10.01 23:45:00 1.592 1.5912 1.591913 1.59155 Red 1


From the above data you can see that there are 11 red candles instead of 12.


Attached is the test EA if anyone wants to try and reproduce the results, but most of all I need a bit of help here, its probably something that I am doing wrong or misinterpreting. I think I have found a similar problem in the iMACD indicator but have not fully checked the results.


regards,


tom...

Files: