Incorrect OHLC Data When Gathering Data From MT4 Strategy Builder

 
I have 2 EAs that I intend to use to gather custom data by running the EA in MT4 strategy builder and a CSV file is dropped containing the data. the file is working fine except for saving the OHLC data. It is saving the same price all through OHLC per one timestamp. See below:

time open high low close atr cci macd rsi stoch wpr
1/4/1999 0:00​
1.1801​
1.1801​
1.1801​
1.1801​
0.01175​
44.63768​
0.002918​
53.89172​
55.36649​
-32.4219​
1/5/1999 0:00​
1.1815​
1.1815​
1.1815​
1.1815​
0.011264​
42.66631​
0.003031​
55.10526​
34.04255​
-31.2115​
1/6/1999 0:00​
1.1761​
1.1761​
1.1761​
1.1761​
0.01075​
-16.7771​
0.002355​
50.26119​
13.56707​
-51.2438​
1/7/1999 0:00​
1.1623​
1.1623​
1.1623​
1.1623​
0.011279​
-135.825​
0.000225​
40.57499​
14.68254​
-83.0918​
1/8/1999 0:00​
1.1713​
1.1713​
1.1713​
1.1713​
0.011114​
-58.9161​
0.000358​
47.53685​
35.36364​
-61.3527​
1/11/1999 0:00​
1.1575​
1.1575​
1.1575​
1.1575​
0.01135​
-140.599​
-0.00166​
38.43279​
25.09921​
-90.3226​
1/12/1999 0:00​
1.1504​
1.1504​
1.1504​
1.1504​
0.011236​
-148.168​
-0.00341​
34.77543​
8.826584​
-96.4583​

I have attached the codes... kindly assist identify and rectify the issue(s).
 
bmkinyua running the EA in MT4 strategy builder and a CSV file is dropped containing the data. the file is working fine except for saving the OHLC data. It is saving the same price all through OHLC per one timestamp. See below:

time open high low close atr cci macd rsi stoch wpr
1/4/1999 0:00​
1.1801​
1.1801​
1.1801​
1.1801​
0.01175​
44.63768​
0.002918​
53.89172​
55.36649​
-32.4219​
1/5/1999 0:00​
1.1815​
1.1815​
1.1815​
1.1815​
0.011264​
42.66631​
0.003031​
55.10526​
34.04255​
-31.2115​
1/6/1999 0:00​
1.1761​
1.1761​
1.1761​
1.1761​
0.01075​
-16.7771​
0.002355​
50.26119​
13.56707​
-51.2438​
1/7/1999 0:00​
1.1623​
1.1623​
1.1623​
1.1623​
0.011279​
-135.825​
0.000225​
40.57499​
14.68254​
-83.0918​
1/8/1999 0:00​
1.1713​
1.1713​
1.1713​
1.1713​
0.011114​
-58.9161​
0.000358​
47.53685​
35.36364​
-61.3527​
1/11/1999 0:00​
1.1575​
1.1575​
1.1575​
1.1575​
0.01135​
-140.599​
-0.00166​
38.43279​
25.09921​
-90.3226​
1/12/1999 0:00​
1.1504​
1.1504​
1.1504​
1.1504​
0.011236​
-148.168​
-0.00341​
34.77543​
8.826584​
-96.4583​

I have attached the codes... kindly assist identify and rectify the issue(s).
  1. You don't mean strategy builder; that makes code. You could mean strategy tester. But since it is a script, you can just drop it on a chart. Remember if you are running it in the tester, the output is in «DataFolder»/tester/Files, not in «DataFolder»/Files

  2. You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
              Event Handling Functions - MQL4 Reference
              How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016)

  3. Your posted result show different prices, not the same. Nothing to rectify.

 
William Roeder #:
  1. You don't mean strategy builder; that makes code. You could mean strategy tester. But since it is a script, you can just drop it on a chart. Remember if you are running it in the tester, the output is in «DataFolder»/tester/Files, not in «DataFolder»/Files

  2. You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
              Event Handling Functions - MQL4 Reference
              How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016)

  3. Your posted result show different prices, not the same. Nothing to rectify.

I was able to resolve.