logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
noumann  
#1 Posted : Wednesday, October 21, 2009 5:01:12 PM(UTC)
noumann

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
johnl  
#2 Posted : Wednesday, October 21, 2009 8:26:46 PM(UTC)
johnl

Rank: Advanced Member

Groups: Registered, Registered Users
Joined: 11/7/2005(UTC)
Posts: 602

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".

Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.