Rank: Advanced Member
Groups: Registered, Registered Users, Unverified Users Joined: 10/16/2009(UTC) Posts: 34
|
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 v9<0, v9, 0);
h1; 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
|