BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Index filter as ribbon
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Index filter as ribbon

 Post Reply Post Reply
Author
Message / View First Unread Post
jakethedog View Drop Down
Newbie
Newbie
Avatar

Joined: 05 Sep 2007
Posts: 8
Post Options Post Options   Quote jakethedog Quote  Post ReplyReply Direct Link To This Post Topic: Index filter as ribbon
    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
Back to Top
Niftyg View Drop Down
Newbie
Newbie
Avatar

Joined: 23 Mar 2011
Location: Gold Coast
Posts: 11
Post Options Post Options   Quote Niftyg Quote  Post ReplyReply Direct Link To This Post Posted: 13 Dec 2014 at 6:24pm
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);
Back to Top
jakethedog View Drop Down
Newbie
Newbie
Avatar

Joined: 05 Sep 2007
Posts: 8
Post Options Post Options   Quote jakethedog Quote  Post ReplyReply Direct Link To This Post Posted: 15 Dec 2014 at 11:11am
Thanks Nifty,

Works a treat!!!!

Jake
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