[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Newbie Problem Looping the last 15 days. It maybe me. Maybe AMI broker.



PureBytes Links

Trading Reference Links

Hi,


I want to back test the last 15 days (ONLY) for some data anomalies 
like gapup, etc. I have a simple (STARTER!) function for this 
below.  I'm beginning to think I don't see array processing 
correctly. 

I did read the manual on arrays and it's not clear on some points so 
finally I did the following:

Filter =  (Close[0] > 4.0)  ;


AddColumn(Close, "Close");
AddColumn(Close[0], "Close0");
AddColumn(Close[1], "Close1");
AddColumn(Close[2], "Close2");


Which gets:
Ticker	Date/Time	Close	close1	close2	close3	close4	
JCP	11/9/2006	79.55	53.75	52.21	53.40	54.18	


Clearly, I'm not getting correct elemens of the array. The values 
shhould all be it ther $70's. Maybe I misunderstood the
Manual but the page on arrays is skimpy and poorly written.


Maybe someone can just point me to some better 
examples/documentation.

I read it that "close[0] equals day1 in his tables??"

I'm using QP3.

Or maybe show me what's wrong with the below function.

Thanks for Any suggestions,
BobLenard (programming newbie)


// *************************
////


function Dropper(period)
{ 
yesno = 0;

global dropdelta;

dropdelta[0] = 0; //initaliation & needed for debug!

  for (i = 1; i <= 15; i++)
   {
    dropdelta [i] =  High[i] -  Low [i +1 ] ;
   }


  for (j = 1; j <= period; j++)
   {
    if ( dropdelta[ j ] < 0)
     yesno = 1;
   }

return yesno;

}


gotadrop = Dropper(15);


Filter =  (Close[0] > 4.0)  ;

AddColumn(Close, "Close");

AddColumn(dropdelta[1], "dtest1");

AddColumn(dropdelta[2], "dtest2");

AddColumn(dropdelta[3], "dtest3");

AddColumn(dropdelta[4], "dtest4");






Content-Description: "AVG certification"
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.1.409 / Virus Database: 268.14.11/542 - Release Date: 11/20/2006