thanks Roy it works fine

On 12/08/2013 11:55 AM, Roy Larsen wrote:

Hi Keith
I'm not sure that I fully understand your request but from what I think you've requested I've added a couple of extra outputs. One generates a zero-based plot that goes positive and negative. The second set of added outputs allow you to have one colour for positive values, and another colour for negative values.
Regards
Roy
{Momentum - Normalized by Jose Silva }
{ Normalized Momentum v3.1 }
{ (c)Copyright 2003-2004 Jose Silva }
{ http://www.metastocktools.com <http://www.metastocktools.com/> }
pds:=Input("Momentum periods",1,2520,10);
pdsN:=Input("normalizing periods (1=none)",
1,2520,63);
x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6",1,6,4);
plot:=Input("Momentum=1, midpoint crossover Signals=2",1,2,1);
x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,P,C)))));
y:=Ref(x,-pds);
ratio:=Min(x,y)/Max(x,y);
Mom:=If(x>y,2-ratio,ratio)*100-100;
MomNorm:=(Mom-LLV(Mom,pdsN))
/(HHV(Mom,pdsN)-LLV(Mom,pdsN)+.000001)*100;
MomNorm:=If(pdsN=1,Mom,MomNorm);
midpt:=If(pdsN=1,0,
Cum(MomNorm)/Cum(IsDefined(MomNorm)));
signals:=
Cross(MomNorm,midpt)-Cross(midpt,MomNorm);
midpt;If(plot=2,signals,MomNorm);
 {conversion to zero-based output}
dif:=MomNorm-midpt;
 {single-colour output}
 {all values}
dif;
 {or two-colour output}
 {positive values}
If(dif>0,dif,0);
 {negative values}
If(dif<0,dif,0);

    ----- Original Message -----
    *From:* a <mailto:[email protected]>
    *To:* [email protected]
    <mailto:[email protected]>
    *Sent:* Saturday, August 10, 2013 10:49 AM
    *Subject:* [EquisMetaStock Group] momentum histogram

    I want to show Momentum as a histogram but for some reason, it only
    shows all above the line & none below

    this is Jose's normalised momentum
    {Momentum - Normalized by Jose Silva }
    { Normalized Momentum v3.1 }
    { (c)Copyright 2003-2004 Jose Silva }
    { http://www.metastocktools.com }
    pds:=Input("Momentum periods",1,2520,10);
    pdsN:=Input("normalizing periods (1=none)",
    1,2520,63);
    x:=Input("use Open=1 High=2 Low=3 Close=4 Volume=5 P=6",1,6,4);
    plot:=Input("Momentum=1, midpoint crossover Signals=2",1,2,1);

    x:=If(x=1,O,If(x=2,H,If(x=3,L,If(x=5,V,If(x=6,P,C)))));
    y:=Ref(x,-pds);
    ratio:=Min(x,y)/Max(x,y);
    Mom:=If(x>y,2-ratio,ratio)*100-100;
    MomNorm:=(Mom-LLV(Mom,pdsN))
    /(HHV(Mom,pdsN)-LLV(Mom,pdsN)+.000001)*100;
    MomNorm:=If(pdsN=1,Mom,MomNorm);
    midpt:=If(pdsN=1,0,
    Cum(MomNorm)/Cum(IsDefined(MomNorm)));
    signals:=
    Cross(MomNorm,midpt)-Cross(midpt,MomNorm);

    midpt;If(plot=2,signals,MomNorm)

    any suggestions welcome as how to show a normal histogram
    thanks
    Keith



    __________ Information from ESET NOD32 Antivirus, version of virus
    signature database 8677 (20130811) __________

    The message was checked by ESET NOD32 Antivirus.

    http://www.eset.com



__________ Information from ESET NOD32 Antivirus, version of virus signature database 8677 (20130811) __________

The message was checked by ESET NOD32 Antivirus.

http://www.eset.com


Reply via email to