/* Program:     atr_values_test
** Author:      Joshua Chellew
** Purpose:     To understand the state of arrays. I wrote this 
program in order to get a better understanding
**                              of the runtime behaviour and how it 
works on the state of arrays
** Findings:    I suspect I may have found a bug. The value of Jstop
[1] is unexpected. I expected Jstop[1] to have 
**                              the value '0'. I used a 3rd party 
utility called 'DebugView' in order to read the _TRACE calls. I 
**                              ran this AFL program as a weekly 
system on 1 ticker/company. When I ran a scan, this is what I found:
**
                                        [2524] at the start of 'ATR 
Values test' program
                                        [2524] Close[0] = 13.3582, 
Jstop[0] = 13.3582
                                        [2524] Close[1] = 13.2819, 
Jstop[1] = 2.29594e-038
                                        [2524] Close[2] = 13.1778, 
Jstop[2] = 0
                                        [2524] Close[3] = 13.1708, 
Jstop[3] = 0
                                        [2524] Close[4] = 12.8447, 
Jstop[4] = 0

                                        ..........


                                        ..........


                                        [2524] Close[201] = 8, Jstop
[201] = 0
                                        [2524] Close[202] = 8.29, 
Jstop[202] = 0
                                        [2524] Close[203] = 8.36, 
Jstop[203] = 0
                                        [2524] Close[204] = 8.43, 
Jstop[204] = 0
                                        [2524] Close[205] = 8.38, 
Jstop[205] = 0
                                        [2524] Close[206] = 8.39, 
Jstop[206] = 0

**
**                      You will notice Jstop[1] has a 
value '2.29594e-038' which I find strange and unexpected because the 
program
**                      only assigns Jstop[0]. It does not assign 
Jstop[1] and therefore I expect it's value to be '0'. I can't find 
**                      any explanation other than a bug in AFL/AB. 
*/


_TRACE("at the start of 'ATR Values test' program");

Jstop[0] = Close[0];

for(i = 0; i < BarCount - 1; i++)
{
        _TRACE("Close["+ i +"] = " + Close[i] +  
                        ", Jstop["+ i +"] = " + Jstop[i]);      
}

Buy = 0;
Sell = 0;

Reply via email to