Compare Price to 5 weeks ago
Moderator: Chris White
Compare Price to 5 weeks ago
I know how to compare price (close) from one day to another by using the (Ref(C,1), but how would I reference a close from 5 weeks ago? Would it be (Ref(C,35)? I'm just not sure if there is a callout for weeks or if you just multiply by 7. Thanks.
-
- Posts: 212
- Joined: Mon Nov 29, 2010 9:21 pm
Re: Compare Price to 5 weeks ago
You can do it both ways with slightly different meanings:
1. REF(C, 25)
Means reference the close price of 25 trading days ago (approx 5 weeks)
2. FML('REF(C, 5)#WEEK1')
Means reference the weekly close price of 5 weeks ago.
Here's a chart with both of these indicators applied so that you can see what the difference is (note that the weekly indicator only changes once per week whereas the daily indicator changes daily):
1. REF(C, 25)
Means reference the close price of 25 trading days ago (approx 5 weeks)
2. FML('REF(C, 5)#WEEK1')
Means reference the weekly close price of 5 weeks ago.
Here's a chart with both of these indicators applied so that you can see what the difference is (note that the weekly indicator only changes once per week whereas the daily indicator changes daily):
Re: Compare Price to 5 weeks ago
Chris,
I'm having a problem with my script
REF(C, 25);
FML('REF(C, 5)#WEEK1');
which I copied into a new script based on your previous post on this subject.
My plot of the 5 week back close data only shows points for the last 20 bars on a 2 year weekly chart and 20 sets of 5 bars on a 2 year daily plot.
Is there some parameter I'm supposed to use to get this plot to work across the majority of my 2 years of data?
Thanks,
Ed S.
I'm having a problem with my script
REF(C, 25);
FML('REF(C, 5)#WEEK1');
which I copied into a new script based on your previous post on this subject.
My plot of the 5 week back close data only shows points for the last 20 bars on a 2 year weekly chart and 20 sets of 5 bars on a 2 year daily plot.
Is there some parameter I'm supposed to use to get this plot to work across the majority of my 2 years of data?
Thanks,
Ed S.