logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Jose  
#1 Posted : Saturday, December 24, 2005 4:17:50 PM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
This handy indicator works in a similar way to MetaStock's Ref() function, but uses calendar days (instead of data bars) for its lookback periods. Calendar days lookback is from the last chart bar only. [code:1:690c50aafc] ================== Calendar day Ref() ================== ---8<---------------------- { CalendarDay-based Ref() function v1.0 ©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, available from http://www.metastocktools.com/#metastock } calendar:=Fml("Calendar Day counter"); { Calendar day CountDown } countDown:=LastValue(calendar)-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:690c50aafc] Wishing all a Merry Xmas, and a Happy & Prosperous 2006! jose '-)
wabbit  
#2 Posted : Saturday, December 24, 2005 10:55:22 PM(UTC)
wabbit

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers, Unverified Users
Joined: 10/28/2004(UTC)
Posts: 3,111
Location: Perth, Western Australia

Was thanked: 16 time(s) in 16 post(s)
Nice work Jose. Richard Dale also has his external file to do the same thing. Now people have a choice! wabbit :D Merry Xmas and Best Wishes in 2006 [censored]ooo
Jose  
#3 Posted : Sunday, December 25, 2005 7:49:32 AM(UTC)
Jose

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 1/19/2005(UTC)
Posts: 1,065
Location: Koh Pha-Ngan, Earth

Was thanked: 2 time(s) in 2 post(s)
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 '-)
Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.