[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[EquisMetaStock Group] Re: Pivotal EMA (PEMA)



PureBytes Links

Trading Reference Links

Roy,

Very valid points and ones I couldn't agree more with! The space 
issue is one I've come across several times. I also have another pet 
peeve...not being able to use assigned convention names. This one I 
understand though and have been able to circumvent by using numbers 
for letters...zero for the letter "O". 

When I tried the PEMA using the older version of the DLL I had I got 
an error message telling me that the DLL did not exist. After the 
change it worked great. I just wanted anyone else who ran across the 
problem to understand the solution. Reckon we can blame the frenchman 
for this one.:-) Then again we'll have to thank him as well. Having 
all these DLL's to work with is great!

Preston



--- In equismetastock@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxxx> 
wrote:
>
> Hi Preston
> 
> 
> The name of a dll is immaterial as far as I can gather. I use the 
ForumDll but have renamed it as "Forum" for my own use. I'd use a 
shorter name still if I could think of anything appropriate. Marks 
GlobalVar will always be GV in my code, though I also have copies 
that only use a single letter for the name.
> 
> I think it would be useful if the programmers writing dlls could 
grasp the concept that MetaStock has very limited space for 
individual formulas. Short names are far preferable to names that 
have the appearance of being sentences without spaces. 
> 
> Renaming Dlls is easy and effective (or renaming a copy perhaps), 
but shortening internal function names is not possible for most 
users. I notice that ForumDll.dll has a VarSUM function, while 
ASI.dll has a SUM function. They're both variable period summations 
but one is much more economical with the available space. The 
Enhanced System Tester windows only accept a little over 1000 
characters, and long formula and function names to nothing to ease 
that problem.
> 
> I do appreciate the capabilities of some of the new free dlls being 
created, but sometimes I think it would be good if the developers 
knew more about MetaStock and less about programming. Just my 
thoughts.
> 
> 
> Regards
> 
> Roy
>  
> ----- Original Message ----- 
> From: pumrysh 
> To: equismetastock@xxxxxxxxxxxxxxx 
> Sent: Sunday, November 13, 2005 6:27 AM
> Subject: [EquisMetaStock Group] Re: Pivotal EMA (PEMA)
> 
> 
> Jose,
> 
> Thanks for sharing this...a very interesting concept.
> 
> The Forum Dll that you used is a newer version than the one we have 
> in our files section. In order to use the one in our files section 
> the term "DLL" must be added to the variable ExtFml name...
> 
> example: pkEma:=ExtFml("Forum.VarMOV",pkVal,pds,e);
> 
> change to: pkEma:=ExtFml("ForumDLL.VarMOV",pkVal,pds,e);
> 
> or just go to the Equis Forum site and obtain the newer version.:-)
> 
> Preston
> 
> 
> --- In equismetastock@xxxxxxxxxxxxxxx, "Jose Silva" 
> <josesilva22@xxxx> wrote:
> >
> > Below is a relatively new type of Exponential Moving Average 
(EMA), 
> > based on price, modulated by price peaks/troughs.
> > 
> > Basically, the Pivotal EMA (PEMA) generally hugs the price closer 
> as 
> > it approaches market turning points.  This can be useful as a 
> possible 
> > improvement to the standard EMA in crossover stops.
> > 
> > The first PEMA version uses the standard PREV functions to 
> construct 
> > the EMA. The second plots much faster thanks to the use of 
variable-
> > period DLLs.
> > 
> > 
> > MetaStock -> Tools -> Indicator Builder -> New ->
> > Copy and paste complete formulae between "---8<---" lines.
> > 
> > =============
> > EMA - pivotal
> > =============
> > ---8<------------------------------------
> > 
> > { Pivotal Exponential Moving Average v1.0 }
> > 
> > { PEMA based on trough/peak support/resistance.
> >   Options:
> >    [1] Composite EMA: (Upper+Lower)/2;
> >    [2] Upper EMA band based on peaks;
> >        Lower EMA band based on troughs;
> >    [3] EMA shifts to Upper/Lower on crossovers }
> > 
> > { ©Copyright 2004~2005 Jose Silva.
> >   The grant of this license is for personal use
> >    only - no resale or repackaging allowed.
> >   All code remains the property of Jose Silva.
> >   http://www.metastocktools.com }
> > 
> > { User inputs }
> > pds:=Input("EMA periods",1,2520,21)/2;
> > plot:=Input("EMA: [1]Composite,  [2]Upper+Lower,  [3]
> Long/Short",1,3,
> > 1);
> > spread:=Input("Upper/Lower EMA bands shift %",
> >  0,100,2)/200;
> > x:=Input("use:  [1]Close,  [2]High/Low",1,2,1);
> > 
> > { Peak/Troughs }
> > xpk:=If(x=1,C,H);
> > pk:=xpk<Ref(xpk,-1) AND Ref(xpk,-1)>Ref(xpk,-2);
> > pkVal:=ValueWhen(1,pk,Ref(xpk,-1));
> > xtr:=If(x=1,C,L);
> > tr:=xtr>Ref(xtr,-1) AND Ref(xtr,-1)<Ref(xtr,-2);
> > trVal:=ValueWhen(1,tr,Ref(xtr,-1));
> > 
> > { Peak-based EMA }
> > pkpds:=If(pds>Cum(pk),Cum(pk),pds);
> > pkpds:=If(pkpds<1,1,pkpds);
> > pkEma:=pkVal*2/(pkpds+1)+PREV*(1-2/(pkpds+1));
> > pkEma:=pkEma*(1+spread);
> > 
> > { Trough-based EMA }
> > trpds:=If(pds>Cum(tr),Cum(tr),pds);
> > trpds:=If(trpds<1,1,trpds);
> > trEma:=trVal*2/(trpds+1)+PREV*(1-2/(trpds+1));
> > trEma:=trEma*(1-spread);
> > 
> > { Composite EMA }
> > Ema:=(pkEma+trEma)/2;
> > LngShtEma:=If(C>=Ema,trEma,pkEma);
> > 
> > { Plot on price chart }
> > If(plot=1,Ema,If(plot=2,trEma,LngShtEma));
> > If(plot=1,Ema,If(plot=2,pkEma,LngShtEma))
> > 
> > ---8<------------------------------------
> > 
> > 
> > 
> > ==========================
> > EMA - pivotal, dll version
> > ==========================
> > ---8<------------------------------------
> > 
> > { Pivotal Exponential Moving Average v.dll
> >   - Plots much faster than PREV-based version.}
> > 
> > { PEMA based on trough/peak support/resistance.
> >   Options:
> >    [1] Composite EMA: (Upper+Lower)/2;
> >    [2] Upper EMA band based on peaks;
> >        Lower EMA band based on troughs;
> >    [3] EMA shifts to Upper/Lower on crossovers }
> > 
> > { Forum.dll from http://forum.equis.com
> >    or ASI.dll from http://www.thedml.com
> >   must be in:
> >   ...\MetaStock\External Function DLLs\ folder.}
> > 
> > { ©Copyright 2004~2005 Jose Silva.
> >   The grant of this license is for personal use
> >    only - no resale or repackaging allowed.
> >   All code remains the property of Jose Silva.
> >   http://www.metastocktools.com }
> > 
> > { User inputs }
> > pds:=Input("EMA periods",1,2520,21)/2;
> > plot:=Input("EMA: [1]Composite,  [2]Upper+Lower,  [3]
> Long/Short",1,3,
> > 1);
> > spread:=Input("Upper/Lower EMA bands shift %",
> >  0,100,2)/200;
> > x:=Input("use:  [1]Close,  [2]High/Low",1,2,1);
> > 
> > { Peak/Troughs }
> > xpk:=If(x=1,C,H);
> > pk:=xpk<Ref(xpk,-1) AND Ref(xpk,-1)>Ref(xpk,-2);
> > pkVal:=ValueWhen(1,pk,Ref(xpk,-1));
> > xtr:=If(x=1,C,L);
> > tr:=xtr>Ref(xtr,-1) AND Ref(xtr,-1)<Ref(xtr,-2);
> > trVal:=ValueWhen(1,tr,Ref(xtr,-1));
> > 
> > { Peak-based EMA }
> > pkpds:=If(pds>Cum(pk),Cum(pk),pds);
> > pkpds:=If(pkpds<1,1,pkpds);
> > {pkEma:=ExtFml("Forum.VarMOV",pkVal,pds,e);}
> > pkEma:=ExtFml("ASI.EMA",pkVal,pds);
> > pkEma:=pkEma*(1+spread);
> > 
> > { Trough-based EMA }
> > trpds:=If(pds>Cum(tr),Cum(tr),pds);
> > trpds:=If(trpds<1,1,trpds);
> > {trEma:=ExtFml("Forum.VarMOV",trVal,pds,e);}
> > trEma:=ExtFml("ASI.EMA",trVal,pds);
> > trEma:=trEma*(1-spread);
> > 
> > { Composite EMA }
> > Ema:=(pkEma+trEma)/2;
> > LngShtEma:=If(C>=Ema,trEma,pkEma);
> > 
> > { Plot on price chart }
> > If(plot=1,Ema,If(plot=2,trEma,LngShtEma));
> > If(plot=1,Ema,If(plot=2,pkEma,LngShtEma))
> > 
> > ---8<------------------------------------
> > 
> > 
> > jose '-)
> > http://www.metastocktools.com
> >
> 
> 
> 
> 
> 
> 
> 
> --------------------------------------------------------------------
------------
> YAHOO! GROUPS LINKS 
> 
>   a..  Visit your group "equismetastock" on the web.
>     
>   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. 
> 
> 
> --------------------------------------------------------------------
------------
>






------------------------ Yahoo! Groups Sponsor --------------------~--> 
Try Online Currency Trading with GFT. Free 50K Demo. Trade 
24 Hours. Commission-Free. 
http://us.click.yahoo.com/RvFikB/9M2KAA/U1CZAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
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/