Wabbit, if you mean Richard Dale's excellent
NexusDate.dll, it can also be used in lieu of the Calendar day indicator in this way:
[code:1:5bb99609d1]
========================
Calendar day Ref() Nexus
========================
---8<----------------------
{ CalendarDay-based Ref() function v Nexus.dll
NexusDate.dll must be in the
...\\MetaStock\\External Function DLLs\\ folder,
available (free) from:
http://www.tradernexus.com/nexusdate
©Copyright 2005 Jose Silva
For personal use only.
http://www.metastocktools.com }
{ User inputs }
days:=Input("Calendar Days lookback",0,36500,7);
x:=Input("[1]Open [2]High [3]Low [4]Close [5]WCl [6]Vol",1,6,4);
plot:=Input("Calendar Lookback: [1]Price, [2]Signal",1,2,1);
{ Data Array }
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,WC(),
If(x=6,V,C)))));
{ Calendar days counter }
calendar:=ExtFml("NexusDate.DaysOld");
{ Calendar day CountDown }
countDown:=calendar-LastValue(calendar);
{ Lookback reference signal }
signalZone:=countDown<=days OR Cum(1)=1;
signal:=signalZone*Alert(signalZone=0,2)
OR Cum(1)=1;
{ Reference price x calendar days ago }
calRef:=If(signalZone,ValueWhen(1,signal,x),x);
{ Plot on price chart }
If(plot=1,calRef,signal)
---8<----------------------
[/code:1:5bb99609d1]
jose '-)