in Search

Jurik Tools for Metastock

Last post 10-21-2009, 20:26 by johnl. 1 replies.
Sort Posts: Previous Next
  •  10-21-2009, 17:01 30977

    Jurik Tools for Metastock

    Hello,
    weeks ago i bought jma and vel tools for MS from mark jurik's website.I'm very interested in studying momentum indicators,so i'm concetrating on vel indicators.Unfortunately,mark don't provide ms code for two interesting elaborations of vel,i.e smooth vel and double vel,both with an option to normalize scale, so you can have a plot whose overall scale is same across all markets.
    Here is the code for vel:
    JRC V__VEL
    { --------------- get price time series ---------------- }
    v1 := Input("Price code {O,H,L,C,V,typ,med} = {1,2,3,4,5,6,7}", 1, 7, 6);
    v2 := If( v1=1 , OPEN, If( v1=2, HIGH, If( v1=3, LOW, If( v1=4, CLOSE, If( v1=5,
    VOLUME, If(v1=6, Typ(), MP() ))))));
    { ------------------------------------------------------ }
    v3 := Input("VEL length", 1, 300, 12);
    v6 := Input("Histogram? (0/2)", 0, 2, 0);
    v7 := ExtFml( "Jurik_Functions.JR_VEL", v2, v3);
    v9 := Sqrt(Abs(v7)) * ( v7 / (Abs(v7)+0.0000000001) );
    h1 := If( v6>0 AND v9>0, v9, 0);
    h2 := If( v6>0 AND v9h1; h2; 0; v9

    In order to get the double vel cod,i'm trying to write the following :
    Custom Double Vel
    { --------------- get price time series ---------------- }
    v1 := Input("Price code {O,H,L,C,V,typ,med} = {1,2,3,4,5,6,7}", 1, 7, 6);
    v2 := If( v1=1 , OPEN, If( v1=2, HIGH, If( v1=3, LOW, If( v1=4, CLOSE, If( v1=5,
    VOLUME, If(v1=6, Typ(), MP() ))))));
    { ------------------------------------------------------ }
    v3 := Input("VEL length", 1, 300, 12);
    v6 := Input("Histogram? (0/2)", 0, 2, 0);
    v7 := ExtFml( "Jurik_Functions.JR_VEL", v2, v3);
    v9 := Sqrt(Abs(v7)) * ( v7 / (Abs(v7)+0.0000000001) );
    v10:=Input("Vel2 lenght",1,300,12):
    v11:=ExtFml( "Jurik_Functions.JR_VEL", v9, v10);
    v12:=Sqrt(Abs(v11)) * ( v11 / (Abs(v11)+0.0000000001) );
    0;v12


    I'm not sure to be on the right way,so i ask your help.And "the last but not the least",which is the best way to normalize the indicator scale so to avoid losing its smoothness?
    Thanks
  •  10-21-2009, 20:26 30979 in reply to 30977

    Re: Jurik Tools for Metastock

     To plot two indicators on the same scale use something like:
     
    ti:=100;
    p1 := Fml("aaa");
    p2 := Fml("bbb");
    {------------------------------}
    p1f := 100/(HHV(p1,ti)-LLV(p1,ti));
    p1m := (p1-LLV(p1,ti))*p1f;
    p2f := 100/(HHV(p2,ti)-LLV(p2,ti));
    p2m := (p2-LLV(p2,ti))*p2f;
    {------------------------------}
    p1m;p2m

    I am assuming that is what you want when you said "normalize".

View as RSS news feed in XML