i am dealing with a coding problem i dont know how to resolve efficiently
what i want to do is
first: to reset all the values of the array before last time a condition was true to the minimum value.
then : to get the maximum value of the array.
i am using a for down to loop to fill the array whitch has a fixed length
and two conditions.
Code: Select all
counter = counter + 1 ;
if rsi(c,14) crosses over 50 then
counter = 0 ;
if c > average(c,1000) then
if counter = 1 then begin
for nn = 20 down to 1 begin
array[nn] = array[nn-1] ;
array[nn] = c ;
now the array has twenty elements some of whitch
are stored from the previous time that
the c was greater than the average when the counter equals 1 .
what i mean by that is that the array evey time the condition (c> average) will start
it will carry over values from the previous time that the condition was true.
how can i sort this mess out ?