Thank you so much Apprentice for all your efforts, but it still not working as intended,
However I have found another one of your other codes at this link
http://fxcodebase.com/code/viewtopic.php?f=17&t=60475works much better but still missing almost half the ticks but generates them back when refreshing the view (it's like when the one min consists of 200 or 300 ticks, it generates only around 10 candles of 10 ticks each).
though this indicator works good, but if you can enhance it's efficiency that will be great.
Thanks again