Hi Tan Ming
The timing mechanism for monthly
signals on daily or weekly charts is common to virtually any function
or indicator you might want to display. That includes all code up to the
third "J" variable. Prices are also common - Cm, Hm, Lm, Om for monthly, or
renamed as Cw, Hw, Lw, Ow for weekly. After that the code is very specific to
the result needed.
I'm currently working through a series of articles
in MetaStock Tips & Tricks that explain in detail how to go about creating
such indicators. Hopefully by the end of the series subscribers will be able to
create their own custom weekly/monthly indicators without any further input from
me.
Kind regards
----- Original Message -----
Sent: Monday, June 20, 2005 8:38 PM
Subject: [EquisMetaStock Group] Monthly indicators on weekly
chart
Hi Roy,
Your code on monthly stochastic super imposed on
weekly chart works great. Does the code work only on stochastic only? I wish
to super impose other indicator, eg fml("new indicator"). Which are the
portion should I change?
Regards.
>From: equismetastock@xxxxxxxxxxxxxxx >Reply-To:
equismetastock@xxxxxxxxxxxxxxx >To:
equismetastock@xxxxxxxxxxxxxxx >Subject:
[EquisMetaStock Group] Digest Number 1227 >Date: 20 Jun 2005 08:09:44
-0000 > >There are 4 messages in this issue. > >Topics
in this digest: > > 1. Re:
Getting Ticker Name - IS there a
way? >
From: "bradulrich33" <brad.ulrich@xxxxxxxxxxxxxxxxxxxxx> >
2. Re: Re: Getting Ticker Name - IS there a
way? >
From: "mr. bryan mccormick" <deepfoobar@xxxxxxxxx> >
3. Re: Getting Ticker Name - IS there a
way? >
From: "bradulrich33" <brad.ulrich@xxxxxxxxxxxxxxxxxxxxx> >
4. Re: How to calculate a monthly stochastic on a weekly chart
? >
From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx> > > >________________________________________________________________________ >________________________________________________________________________ > >Message:
1 > Date: Sun, 19 Jun 2005 13:48:57
-0000 > From: "bradulrich33" <brad.ulrich@xxxxxxxxxxxxxxxxxxxxx> >Subject:
Re: Getting Ticker Name - IS there a way? > >Every MSXDataRec (the
basic structure that is passed in when you pass >in a price array)
contains a string (i.e., character array) >called "pszSecurityName". This
will work just fine inside of a DLL, >but unfortunately, you can't return
a string from a DLL, only another >array. > >But several
methods come to mind that may help accomplish your task: > >You can
check to see if the passed in array's name equals a name that >you
hard-code into your >DLL, and return a boolean (zero or one) "constant
array". > >Or you could have a list of names hard-coded into your
DLL, and >return a different numeric "index" for each name in
the >list. > >Finally, you could pass in a name as a string
argument, and then >return zero or one if it matches it or
not. > >Hope this helps, > >Brad Ulrich >TheDML,
LLC > > > >--- In equismetastock@xxxxxxxxxxxxxxx,
"deepfoobar" <deepfoobar@x...> >wrote: > >
Folks, > > > > I am curious if there any way at all to get the
current symbol value > > (ticker) back from MS in formula or
DLL? > > > > BTW this value does not at all have to be
something that MS itself > > recognizes, I simply need to pass it along
as a value to a .DLL. > > > > It seems completely brain-dead
to me that MS never provided a way to > > do this but I won't be
surprised if the answer turns out to >be "there > > is no
way". > > > > > > >________________________________________________________________________ >________________________________________________________________________ > >Message:
2 > Date: Sun, 19 Jun 2005 11:00:27 -0700
(PDT) > From: "mr. bryan mccormick" <deepfoobar@xxxxxxxxx> >Subject:
Re: Re: Getting Ticker Name - IS there a way? > >Very helpful indeed
thanks. So really the .dll can >have access to this record for its own
purposes but it >cannot pass this back to MS because it has no
string >handling facility? > >When a chart is loaded, how does
an external formula >"know' the symbol? Does it? Or does this come from
the >record structure you talked about? > >--- bradulrich33
<brad.ulrich@xxxxxxxxxxxxxxxxxxxxx> >wrote: > >
> Every MSXDataRec (the basic structure that is passed > > in when
you pass > > in a price array) contains a string (i.e.,
character > > array) > > called "pszSecurityName". This will
work just fine > > inside of a DLL, > > but unfortunately, you
can't return a string from a > > DLL, only another > >
array. > > > > But several methods come to mind that may
help > > accomplish your task: > > > > You can check
to see if the passed in array's name > > equals a name that >
> you hard-code into your > > DLL, and return a boolean (zero or
one) "constant > > array". > > > > Or you could have
a list of names hard-coded into > > your DLL, and > > return a
different numeric "index" for each name in > > the > >
list. > > > > Finally, you could pass in a name as a
string > > argument, and then > > return zero or one if it
matches it or not. > > > > Hope this helps, >
> > > Brad Ulrich > > TheDML, LLC > > >
> > > > > --- In equismetastock@xxxxxxxxxxxxxxx,
"deepfoobar" > > <deepfoobar@x...> > > wrote: >
> > Folks, > > > > > > I am curious if there any
way at all to get the > > current symbol value > > >
(ticker) back from MS in formula or DLL? > > > > > > BTW
this value does not at all have to be > > something that MS
itself > > > recognizes, I simply need to pass it along as a >
> value to a .DLL. > > > > > > It seems completely
brain-dead to me that MS never > > provided a way to > > >
do this but I won't be surprised if the answer > > turns out to >
> be "there > > > is no way". > > > > >
> > > >
> > > > > > >__________________________________ >Do
you Yahoo!? >Yahoo! Mail - You care about security. So do
we. >http://promotions.yahoo.com/new_mail > > >________________________________________________________________________ >________________________________________________________________________ > >Message:
3 > Date: Sun, 19 Jun 2005 18:22:23
-0000 > From: "bradulrich33" <brad.ulrich@xxxxxxxxxxxxxxxxxxxxx> >Subject:
Re: Getting Ticker Name - IS there a way? > >Yes, your first
statement is correct. > >Per your second question, most external
formulas (dlls) are >indicators, and therefore are applied without any
knowledge or concern >for the indicator's name, they only care about the
price data. >However, this price structure that is passed in contains lots
of >information that can be accessed by the dll, including the price
data, >the security name, the security symbol, the periodicity (tick,
daily, >weekly, etc.), the start date/time, the end date/time, and a few
others. > >Information regarding this is available in the Metastock
developers >kit, but beware it requires a pretty hefty knowledge of C++
(or >Delphi) and is generally pretty tough to work with. And Equis
charges >for it. > >I think that I may work on a util function
where you can pass in a >name and get back a true or false. Would
that be useful? > >Has anyone else out there got an alternative to
this? Maybe something >with MSFL? I will admit that I know
more about the MDK than "tricks" >and "workarounds" in
Metastock. > >Brad >The DML, LLC > > >--- In
equismetastock@xxxxxxxxxxxxxxx,
"mr. bryan mccormick" ><deepfoobar@x...> wrote: > > Very
helpful indeed thanks. So really the .dll can > > have access to this
record for its own purposes but it > > cannot pass this back to MS
because it has no string > > handling facility? > > >
> When a chart is loaded, how does an external formula > > "know'
the symbol? Does it? Or does this come from the > > record structure
you talked
about? > > > > > > > >________________________________________________________________________ >________________________________________________________________________ > >Message:
4 > Date: Mon, 20 Jun 2005 17:00:01
+1200 > From: "Roy Larsen" <rlarsen@xxxxxxxxxxxxxx> >Subject:
Re: How to calculate a monthly stochastic on a weekly chart ? > >Hi
Marco > > >Here's a monthly stochastic for daily charts. You
can also use it for >weekly charts, but remember that the end-of-month
date is different for >daily and monthly charts than it is for weekly
charts. This is because the >end of a month does not necessarily coincide
with the end of a week. For >example, on a weekly chart May 2005 finished
on the 27th, but on daily and >monthly charts it finished on the
31st. > > >Kind regards > >Roy
Larsen >www.metastocktips.co.nz > > >
{Monthly Stochastic Oscillator EMA} > {2005 Roy Larsen, www.metastocktips.co.nz} >
{for use on daily charts} >N:=Input("Monthly Stochastic Oscillator Periods
(%K)",1,99,14); >K:=Input("%K Slowing Periods"
,1,99,1); >D:=Input("%D EMA Periods",1,99,5); >Q:=Input("Display
Mode, 0=Static 1=Dynamic 2=Test",0,2,1); >
{0=Display, update at end-of-month} > {1=Display, update on
each new bar} > {2=Backtest, update on first bar of new
month} >G:=LastValue(Sum(Month()<>ValueWhen(2,1,Month()),5)=5); >M:=G
OR Month()<>ValueWhen(2,1,Month()); >F:=G OR
PeakBars(1,Zig(If(G*(Cum(1)=1),1,DayOfMonth()),1,$),1)=0; >A:=LastValue(Cum(1)-1)=Cum(1); >B:=ValueWhen(2,1,A); >J:=If(F,1,If(Alert(F,2)=0
AND M,2,0)); >J:=If(A+LastValue(J)>2 OR
B+(Q=1)=2,1,J); >J:=If(G,1,If(Q=2 OR
Cum(J)<=1,M*2,J)); >Hm:=HighestSince(1,M,H); >Hm:=ValueWhen(1,J,If(J=1,Hm,ValueWhen(2-G,1,Hm))); >Lm:=LowestSince(1,M,L); >Lm:=ValueWhen(1,J,If(J=1,Lm,ValueWhen(2-G,1,Lm))); >Cm:=ValueWhen(1,J,If(J=1,C,ValueWhen(2-G,1,C))); >Hm:=ValueWhen(1,Hm>0,Hm); >Lm:=ValueWhen(1,Lm>0,Lm); >Z:=Cum(LowestSince(N,M,Lm)*(J>0)); >Z:=Cm-(Z-ValueWhen(K+1,J,Z)); >I:=Cum((HighestSince(N,J,Hm)-LowestSince(N,J,Lm))*(J>0)); >I:=I-ValueWhen(K+1,J,I); >I:=ValueWhen(1,Cum(I>0)>0,I); >X:=100*Z/I;
A:=2/(1+D); >X:=ValueWhen(1,Cum(J>0)>=K+N,X); >Y:=ValueWhen(1,J,PREV)*(1-A)+X*A; >Y:=ValueWhen(1,Cum(J>0)>=N+K+D,Y); >X;
{%K} >Y; {%D} > > >----- Original Message
----- >From: Khamsina11 >To: equismetastock@xxxxxxxxxxxxxxx >Sent:
Sunday, June 19, 2005 10:18 AM >Subject: [EquisMetaStock Group] How to
calculate a monthly stochastic on a >weekly chart
? > > > >Hi, > >I would like to plot a
monthly stochastic on a weekly chart ? > >Here is the code of the
stochastic I use : > >Mov(Stoch(14,1),5,E) > >Thanks in
advance for your valuable
help, >Regards, > >Marco > > > > > > >___________________________________________________________________________ >Appel
audio GRATUIT partout dans le monde avec le nouveau Yahoo!
Messenger >Téléchargez cette version sur http://fr.messenger.yahoo.com > > > > >-------------------------------------------------------------------------------- >Yahoo!
Groups Links > > a.. To visit your group on the web, go
to: > http://groups.yahoo.com/group/equismetastock/ > >
b.. To unsubscribe from this group, send an email to: > equismetastock-unsubscribe@xxxxxxxxxxxxxxx > >
c.. Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service. > > > >[This message contained
attachments] > > > >________________________________________________________________________ >________________________________________________________________________ > > > >------------------------------------------------------------------------ >Yahoo!
Groups
Links > > > > >------------------------------------------------------------------------ > > >
_________________________________________________________________ Get
your mobile ringtones, operator logos and picture messages from MSN Mobile
http://msn.smsfactory.no/
Yahoo!
Groups Links
<*> To visit your group on the web, go
to: http://groups.yahoo.com/group/equismetastock/
<*>
To unsubscribe from this group, send an email to: equismetastock-unsubscribe@xxxxxxxxxxxxxxx
<*>
Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
Yahoo! Groups Links
|