PDA

View Full Version : MS Exploration referencing future closes.


EricN
12th August 2006, 04:01 PM
In an exploration to do back testing I want to exclude securities that are being acquired or are merging. Typically, I see a large gap up and then an almost flatlined close range. To identify a large gap up only is not sufficient. I must detect the flatlined closing range as well. I coded a Column as follows:

Alert(If(L>Ref(H*1.15,-1),1,0) AND
If((Abs(Ref(C,+1)-Ref(C,+3)))<(C*.005),1,0) AND
If((Abs(Ref(C,+1)-Ref(C,+4)))<(C*.005),1,0),3000)

After the gap up I referenced very small closing differences. All this works fine, but when it comes to filtering there is a problem. Since it references future events, the last result in the column, of course, shows N/A. It appears that the filter only looks at the last line and I have been unable to force it 5 lines back.

Hope you can help. Thanks in advance.

Best regards,
Eric

Jose
12th August 2006, 07:11 PM
Try shifting all code, back four bars:

Alert&#40;
Ref&#40;L,-4&#41;>Ref&#40;H*1.15,-5&#41;
AND Abs&#40;Ref&#40;C,-3&#41;-Ref&#40;C,-1&#41;&#41;<Ref&#40;C*.005,-4&#41;
AND Abs&#40;Ref&#40;C,-3&#41;-C&#41;<Ref&#40;C*.005,-4&#41;
,3000&#41;


jose '-)

EricN
13th August 2006, 05:00 AM
Works like a charm. And so simple.

Thanks a load

Best regards,
Eric