BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Momentum and Trend Strategies
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Momentum and Trend Strategies

 Post Reply Post Reply
Author
Message / View First Unread Post
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
magpie View Drop Down
Newbie
Newbie


Joined: 12 Feb 2009
Posts: 7
Post Options Post Options   Quote magpie Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
maximo View Drop Down
BullCharts Guru
BullCharts Guru
Avatar

Joined: 02 Sep 2006
Location: Australia
Posts: 232
Post Options Post Options   Quote maximo Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Bulletin Board Software by Web Wiz Forums® version 9.69
Copyright ©2001-2010 Web Wiz