Here is the corrected version with higher lows and lower highs. I am attaching executable files and the source. Copy both double click on the Navigator window, to the directory to run it. It can be run on any currency pair for any period. Do not run it on an present chart with different indiors. Should you want any help, this is a good resource:
http://www.forex.factory.com/showthread.php?t=67529
The output CSV files will be found in the experts/files directory and be named something like EURUSDLongMyBar.csv.
https://www.cliqforex.com/attachment...8303374424.ex4
https://www.cliqforex.com/attachment...1682739623.mq4