Richard, Re: back testing
I have been using the For-Next loop function to do back testing. In the following example the starting date of the loop must be (-2) to give be able to print the activity for the two days following the 'hit' day. The help files give an example of using the For-Nest and you just need to experiment with it.
Output "Atest-A"; // Output file input"IssueLst.lst"; // Input file if used IssueType Common; // Only common issues Exchange=NYSE,AMEX,NASDAQ; // only exchanges integer i; // define integer for loop For i = -2 to -69 step -1// set up loop period Do // Do the loop If // Conditions to scan for Close(i)>1.99 and Close(i)75000 and Vol(i)>Vol(i-1) and Vol(i-1)100000 and Then //print the info for the two days following the 'hit' Print Symbol: -7,Date(i):12; Print Open(i):7:3,High(i):7:3,Low(i):7:3,Close(i):7:3,Vol(i):7; Print Open(i+1):7:3,High(i+1):7:3,Low(i+1):7:3,Close(i+1):7:3; Print Open(i+2):7:3,High(i+2):7:3,Low(i+2):7:3,Close(i+2):7:3; PrintLn; endif;// end of conditions //loop to next day next i;
Good Luck and Happy Trading Roy :>)
EDIT; I see in later posts you were helped by others as well, again Good Luck |