Momentum and Trend Strategies |
Post Reply |
Author | |
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options
Quote Reply
Topic: Momentum and Trend Strategies Posted: 13 Oct 2009 at 5:33am |
Paint bars according to agreement of Momentum and RSI.
shows pivot highs and lows in the direction of the trend. IB = inside bar, another method of entry into a trend. [description ="Trading in the direction of Momentum, Max"][target =price]period := input("RSI period",21,1);RS := RSI( C,period);n := input("MOM period",10,1);MOM:=100*( ma((C-Ref(LLV(C,n),-n)),5,E) / ma((HHV(C,n)-LLV(C,n)),5,E));method := inputma("Method",S);[linestyle =pricecolor][color =lime green]If (MOM > 0 and RS > 50,1,0);[color =indian red]If (MOM < 0 and RS < 50,1,0);[color =black]If (MOM < 0 and RS > 50,1,0);If (MOM > 0 and RS < 50,1,0);[linestyle =solid; color=lawn green; width=2]ma (C,period,method);{ inside day } insidebar:= if(H<hist(H,1) and L>hist(L,1),1,0);MAup:= ma(C,period,S)>hist(ma(C,period,S),2)[linestyle =marker; marker=type1; name=IB]if (MOM > 0 and RS > 50 and inside and MAup,1,0);[linestyle =marker; marker=type2; name=IB]if (MOM < 0 and RS < 50 and inside and not MAup,1,0);{ Pivot highs } [linestyle =points; color=blue; width=2]PHl:= if(ref(MAup,1) and ref(H,1)>H and ref(H,1)>ref(H,2),H*1.003,undefined);PHi:= if(MAup and H>ref(H,-1) and ref(H,1)<H,H*1.003,undefined);PHiR:= if(ref(PHi,-1),H*1.003,undefined);PHi; { Pivot lows } [color =red]PLl:= if(not ref(MAup,1) and ref(L,1)<L and ref(L,1)<ref(L,2),L*0.997,undefined);PLo:= if(not MAup and L<ref(L,-1) and ref(L,1)>L,L*0.997,undefined);PLoR:= if(ref(PLo,-1),L*0.997,undefined);PLo; [drawundefined =gap][linestyle =solid; color=blue; width=1]if (PHl,PHl,if(PHi,PHi,if(PHiR,PHiR,undefined)));[color =red]if (PLl,PLl,if(PLo,PLo,if(PLoR,PLoR,undefined)));
Edited by maximo - 15 Oct 2009 at 6:25pm |
|
magpie
Newbie Joined: 12 Feb 2009 Posts: 7 |
Post Options Quote Reply Posted: 18 Oct 2009 at 11:16am |
Hi Maximo,
Many thanks for your excellent posts-appreciated!
I decided to place your Mom.trend into my custom bar,however the price bar colours revert to black after one 'useage.Any thoughts?
|
|
maximo
BullCharts Guru Joined: 02 Sep 2006 Location: Australia Posts: 232 |
Post Options Quote Reply Posted: 18 Oct 2009 at 2:44pm |
The only answer I have to that is to click on the DEFault template or any other template. That reverts the colors. Edited by maximo - 18 Oct 2009 at 2:46pm |
|
Post Reply |
Forum Jump | Forum Permissions 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 |