![]() |
Index filter as ribbon |
Post Reply ![]() |
Author | |
jakethedog ![]() Newbie ![]() ![]() Joined: 05 Sep 2007 Posts: 8 |
![]() ![]() ![]() ![]() Posted: 13 Dec 2014 at 5:19pm |
Hi all,
I must admit firstly that coding has me beat! I was wondering if there was a code for an index filter to be placed at the bottom of a chart as a ribbon. Eg. If 10 day moving average of XJO is up then ribbon green. If 10 day moving average of XJO is down the ribbon red. This ribbon is specific to XJO which I want to place on various different stocks with the idea that the stock won't be bought if the broader market trend (XJO) is red. Thanks in advance for any ideas. Jake |
|
![]() |
|
Niftyg ![]() Newbie ![]() ![]() Joined: 23 Mar 2011 Location: Gold Coast Posts: 11 |
![]() ![]() ![]() ![]() |
Hi Jake,
This isn't exactly what you asked for but is a ribbon for XJO with price above or below its moving average. The number of days and type of moving average is adjustable. Regards Nifty { Indicator Name: Ribbon Index MA } [description="Moving Average ribbon of Index"] [target=Ribbon; category=Moving Average] expr := Expression("Expression",Close); method := inputma("Method",Exponential); n := input("Time periods",42,1); symb := inputsymbol("Compare to", "XJO"); P:=LoadSymbol(symb,expr); [color=Lime Green; name=Above] ref(P,1)>ref(MA(P,n,method),1); [color=Red; name=Below] ref(P,1)<ref(MA(P,n,method),1); |
|
![]() |
|
jakethedog ![]() Newbie ![]() ![]() Joined: 05 Sep 2007 Posts: 8 |
![]() ![]() ![]() ![]() |
Thanks Nifty,
Works a treat!!!! Jake |
|
![]() |
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 |