Compare Price to 5 weeks ago

A forum for all EdgeRater users

Moderator: Chris White

Post Reply
Rickbw
Posts: 5
Joined: Sat Dec 04, 2010 1:48 pm

Compare Price to 5 weeks ago

Post by Rickbw »

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.
Chris White
Posts: 201
Joined: Mon Nov 29, 2010 9:21 pm

Re: Compare Price to 5 weeks ago

Post by Chris White »

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):
dailyvweeklysyntax.jpg
dailyvweeklysyntax.jpg (68.89 KiB) Viewed 12507 times
nibor200
Posts: 63
Joined: Wed Oct 22, 2014 11:03 am

Re: Compare Price to 5 weeks ago

Post by nibor200 »

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.
Post Reply