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

Notification

Icon
Error

Options
Go to last post Go to first unread
KARLMARX  
#1 Posted : Sunday, November 27, 2005 12:21:17 AM(UTC)
KARLMARX

Rank: Newbie

Groups: Registered, Registered Users
Joined: 11/19/2005(UTC)
Posts: 2
Location: FRANCE

Hi, Two questions about time frame and candlesticks functions, please, because i'm stuck: 1/ How can i specify a time frame in metastock language? For example, if i want to find with the explorer if a shootingstar() appeared between November 1st 2005 and November 20th 2005? 2/What do i have to write to know if 3 risingwindow() had appeared since October 1st 2005? Thanks a lot. K.
hayseed  
#2 Posted : Sunday, November 27, 2005 1:19:13 AM(UTC)
hayseed

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 3/7/2005(UTC)
Posts: 1,346

hey karl.... seems i've noticed that type question before, but didn't have a good answer.... some of the better coders be able to answer exactly..... you can do a kinda work around using some of the options in the exploration.... by setting your test date and only loading the proper amount of records it might achieve your result.... in your November 1st 2005 and November 20th 2005 test from 11/20/05 and load 14 records or how many lie between those dates..... thats not the answer you were lookin for but might do until.....h
DOC  
#3 Posted : Monday, November 28, 2005 8:08:49 PM(UTC)
DOC

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/9/2004(UTC)
Posts: 107
Location: Salt Lake City, UT

Karl, THere are date functions for formulas that you can use. to find them in Nov. Year()= 2005 and MOnth()=11 and Dayofmonth()>1 and Dayofmonth()<20 along with the shootingstar() then cum or sum the signal over the period of time. Hope this helps Regards
mstt  
#4 Posted : Monday, November 28, 2005 9:24:53 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Karl A "date filter" is a very useful tool to have. You can easily drop it down into a chart window, adjust the default start and end dates, then run an exploration or do whatever you want to examine signals between your given date range. Once the date filter has appropriate default dates set you could write your formula as Cum(Fml("Date Filter") and RisingWindow())>=3; Using Cum() with a filter inside it is probably a better option than Sum() as you don't need to concern yourself with the number of lookback periods. Cum() sums everything across all loaded data, and that's where a data filter like mine or a simpler formula like Doc's restricts the enabled range of Cum() to just the date range you want. Here's the date filter in case it's of any use. {Date Filter} {© 2003 Roy Larsen, www.metastocktips.co.nz} Sd:=Input("Start day" ,1,31,1); Sm:=Input("Start month",1,12,1); Sy:=Input("Start year" ,1980,2010,2002); Ed:=Input("End day" ,1,31,31); Em:=Input("End month" ,1,12,12); Ey:=Input("End year" ,1980,2010,2005); Start:=(DayOfMonth()>=Sd AND Month()=Sm AND Year()=Sy) OR Year()>Sy OR (Year()=Sy AND Month()>Sm); End:=(DayOfMonth()<=Ed AND Month()=Em AND Year()=Ey) OR Year()<Ey OR (Year()=Ey AND Month()<Em); Filter:=Start AND (End OR (Start AND Alert(Start=0,2))); Filter; Roy MetaStock Tips & Tools
Patrick  
#5 Posted : Monday, November 28, 2005 9:48:16 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Well not to put the Forum.dll forward again but there is a date range function in it ... Patrick :mrgreen:
mstt  
#6 Posted : Monday, November 28, 2005 10:13:57 PM(UTC)
mstt

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/25/2005(UTC)
Posts: 1,042

Was thanked: 57 time(s) in 54 post(s)
Sorry Patrick. I guess I just get so used to making do with my own solutions from way back. I must say that I'm finding new uses for the FormDll on a regular basis so I hope the issues surrounding it's installation in various MS versions are resolved soon. Keep up the good work. Roy MetaStock Tips & Tools
Patrick  
#7 Posted : Monday, November 28, 2005 10:15:44 PM(UTC)
Patrick

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 9/8/2004(UTC)
Posts: 2,266

Was thanked: 1 time(s) in 1 post(s)
Quote:
I hope the issues surrounding it's installation in various MS versions are resolved soon.
I'm working on it quite actively at this time ... I might make 2 version one with the custom index function and one without ... Patrick :mrgreen:
henry1224  
#8 Posted : Tuesday, November 29, 2005 12:31:31 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
I hate to keep harping abut powerPivots Plus but the external functions for creating a multi time frame indicator are included Compare this indicator with the QStick indicator included in Metastock Periods:=Input("Length",1,100,8); factor:=Input("TFactor", 0, 1000, 1); offset:=Input("Offset", 0, 1000, 0); OD:=ExtFml("PowerPivots.TDataCreate",0, factor); CD:=ExtFml("PowerPivots.TDataCreate",3, factor); A1:=Mov((CD-OD),Periods,S); Sig:=Mov(A1,5,S); A1:=ExtFml("PowerPivots.TDataLocalize",A1, factor, offset); Sig:=ExtFml("PowerPivots.TDataLocalize", Sig, factor, offset); 0;A1;Sig; The above indicator can plot the Value of an indicator from a higher time frame Factor =1 plots just like a normal indicator Factor =2 Plots 2 X the base time frame IE; if you chart a 1 min chart factor =2 will plot the indicator from a 2 min chart onto the 1 min chart if you chart a 5 min chart factor =2 will plot the indicator from a 10 min chart onto the 5 min chart if you chart a daily chart factor =2 will plot the indicator from a weekly chart onto the daily chart
henry1224  
#9 Posted : Tuesday, November 29, 2005 2:02:02 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
{Ehlers TASC Jul 00, p. 29} factor:=Input("TFactor", 0, 1000, 1); offset:=Input("Offset", 0, 1000, 0); HD:=ExtFml("PowerPivots.TDataCreate",1, factor); LD:=ExtFml("PowerPivots.TDataCreate",2, factor); P1:=(HD+LD)/2; V1:=P1 + 0.088*Ref(PREV,-5); V2:=ROC(V1,6,$) + 1.2*Ref(PREV,-5) - 0.7*Ref(PREV,-11); D1:=Ref(V2,-12) - (2*Ref(V2,-6))+V2; S1:=0.13785*(2*D1-Ref(D1,-1))+0.0007*(2*Ref(D1,-1)-Ref(D1,-2))+0.13785*(2*Ref(D1,-2)-Ref(D1,-3))+(1.2103*PREV)-(0.4867*Ref(PREV,-1)); S2:=0.13785*(2*S1-Ref(S1,-1))+0.0007*(2*Ref(S1,-1)-Ref(S1,-2))+0.13785*(2*Ref(S1,-2)-Ref(S1,-3))+1.2103*PREV-0.4867*Ref(PREV,-1); Green:=If(S1>Ref(S1,-1),S1,0); Red:=If(S1<Ref(S1,-1),S1,0); Red:=ExtFml("PowerPivots.TDataLocalize", Red, factor, offset); Green:=ExtFml("PowerPivots.TDataLocalize", Green, factor, offset); S2:=ExtFml("PowerPivots.TDataLocalize", S2, factor, offset); Green;Red; S2;
henry1224  
#10 Posted : Tuesday, November 29, 2005 2:04:06 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
factor:=Input("TFactor", 0, 1000, 1); offset:=Input("Offset", 0, 1000, 0); CD:=ExtFml("PowerPivots.TDataCreate",3, factor); Raschke:= Mov(CD,3,S) - Mov(CD,10,S); A:=Mov(Raschke,16,E); Green:=If(A>Ref(A,-1),A,0); Red:=If(A<Ref(A,-1),A,0); Signal:=Mov(A,5,S); Green:=ExtFml("PowerPivots.TDataLocalize",Green, factor, offset); Red:=ExtFml("PowerPivots.TDataLocalize",Red, factor, offset); Signal:=ExtFml("PowerPivots.TDataLocalize",Signal, factor, offset); Signal; Green; Red;
henry1224  
#11 Posted : Tuesday, November 29, 2005 2:07:06 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
factor:=Input("TFactor", 0, 1000, 1); offset:=Input("Offset", 0, 1000, 0); OD:=ExtFml("PowerPivots.TDataCreate",0, factor); HD:=ExtFml("PowerPivots.TDataCreate",1, factor); LD:=ExtFml("PowerPivots.TDataCreate",2, factor); UC:=Ref(HHV(HD,10),-2); LC:=Ref(LLV(LD,10),-2); A1:=Ref(Mov(HD,3,S),-0); A2:=Ref(Mov(LD,3,S),-0); FF:=If((UC-LC)<=1.75,1.25,If((UC-LC)<=2.75,1.,If((UC-LC)<=7.75,.75,.5))); OP:=If(A1>UC,ValueWhen(1,Cross(A1,UC),OD+FF),If(LC>A2,ValueWhen(1,Cross(LC,A2),OD-FF),PREV)); UC:=ExtFml("PowerPivots.TDataLocalize",UC, factor, offset); LC:=ExtFml("PowerPivots.TDataLocalize",LC, factor, offset); A1:=ExtFml("PowerPivots.TDataLocalize",A1, factor, offset); A2:=ExtFml("PowerPivots.TDataLocalize",A2, factor, offset); OP:=ExtFml("PowerPivots.TDataLocalize",OP, factor, offset); UC;LC;A1;A2;OP;
henry1224  
#12 Posted : Tuesday, November 29, 2005 2:36:26 AM(UTC)
henry1224

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 10/29/2004(UTC)
Posts: 1,394
Location: Glastonbury, CT

Was thanked: 2 time(s) in 2 post(s)
factor:=Input("Time Factor", 0, 1000, 1); Trendfactor:=Input("Trend Factor", 0, 1000, 2); offset:=Input("Offset", 0, 1000, 0); TD:=ExtFml("PowerPivots.TrendDirection",1,TrendFactor); HD:=ExtFml("PowerPivots.TDataCreate",1, factor); LD:=ExtFml("PowerPivots.TDataCreate",2, factor); LL:=If(LD=LLV(LD,5),LD,If(Ref(LD,-1)=LLV(LD,5),Ref(LD,-1),If(Ref(LD,-2)=LLV(LD,5),Ref(LD,-2),If(Ref(LD,-3)=LLV(LD,5),Ref(LD,-3),If(Ref(LD,-4)=LLV(LD,5),Ref(LD,-4),0))))); HH:=If(HD=HHV(HD,5),HD,If(Ref(HD,-1)=HHV(HD,5),Ref(HD,-1),If(Ref(HD,-2)=HHV(HD,5),Ref(HD,-2),If(Ref(HD,-3)=HHV(HD,5),Ref(HD,-3),If(Ref(HD,-4)=HHV(HD,5),Ref(HD,-4),0))))); NH:=ValueWhen(1,HD>Ref(HHV(HD,5),-1),HD); NL:=ValueWhen(1,LD<Ref(LLV(LD,5),-1),LD); Set1:=HHV(HD,3)<HHV(HD,4); Set2:=LLV(LD,3)>LLV(LD,4); Val1:=ValueWhen(1,BarsSince(HD>Ref(HHV(HD,5),-1))=3 AND Set1=true,NH); Val2:=ValueWhen(1,BarsSince(LD<Ref(LLV(LD,5),-1))=3 AND Set2=true,NL); Val3:=ValueWhen(1,BarsSince(HD>Ref(HHV(HD,5),-1))=3 AND Set1=true,LL); Val4:=ValueWhen(1,BarsSince(LD<Ref(LLV(LD,5),-1))=3 AND Set2=true,HH); TB:=If(Sum(TD>0,2)>1,Val1,Val4); BB:=If(Sum(TD>0,2)>1,Val3,Val2); TB:=ExtFml("PowerPivots.TDataLocalize",TB, factor, offset); BB:=ExtFml("PowerPivots.TDataLocalize",BB, factor, offset); TB;BB; just make sure That trend factor is greater than Time factor
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.