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

Referencing X bars back



PureBytes Links

Trading Reference Links


Hi there everyone,
 
I have been lurking on the list for the last few 
months and found the list a wealth of information.
 
I now need some help with a formula for an 
exploration I am fiddling with.
 
I have an Alert Exploration showing which shares 
have had a 50 day Moving average cross above a 200 moving average. The Alert 
shows how many days ago the last cross over occurred. The formula is as 
follows:-
 
<FONT face=Arial 
size=2>BarsSince(Cross(Mov(CLOSE,50,S),Mov(CLOSE,200,S)))
 
What I would now like to do is find out what the 
numerical difference between the 200 and 50 day moving ave for both days 
"before" the occurrence was.
 
So theoretically if the alert showed that the 
crossover happened 12 days ago, Col B and Col C would show the Moving average 
difference for 13 and 14 days previously.
 
Can someone help with the formula. I would really 
appreciate it.
 
A last question. How would I write a formula 
referencing x bars back. I.E. If I wanted to know the close of 6 bars ago, how 
would I write this. I have searched like mad through the MS help, but just cant 
seem to find it. I am sure it is a mental block.
 
Thanks for any help.
 
Many regards
 
Glynn