BullCharts Forum Homepage
Forum Home Forum Home > BullCharts > BullScript
  New Posts New Posts RSS Feed: Coloring of an indicator
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Coloring of an indicator

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

Joined: 29 Jul 2010
Location: Sweden
Posts: 8
Post Options Post Options   Quote stefanols Quote  Post ReplyReply Direct Link To This Post Topic: Coloring of an indicator
    Posted: 27 Nov 2017 at 4:19pm
Anyone? 
The other instrument can be anything AAPL etc. I am just after 
hot to color the result. 

Hi, 

I am trying to make an indicator easier to read. 
However it does not turn out as I would like. 
I would like to have plot in green when above 65, red below 35 and the rest in black. 

Hope that someone can assist. Thanks in advance BR Stefan 

[target=Default;Horzline=80,15]
[tooltip= CPI Bulkowski, "36-64 Neutral, 65-100 Bullish, 1-35 Bearish,1-35"]

{Calculate the realtion between bullish and bearish CPI count}

symb := inputsymbol("Security","AAPL");
otherClose := LoadSymbol(symb, Close);
total := close+otherclose;


CPI :=(close)/total*100;

CPIBU := if(CPI >= 65,CPI,undefined);
CPIBE := if(CPI < 36,CPI,undefined);
CPINE := if(CPI >36 or CPI>65,CPI,undefined);


[linestyle=Line; width=2; color=green]
CPIBU;
[linestyle=Line; width=2; color=red]
CPIBE;
[linestyle=Line; width=2; color=black]
CPINE;









Edited by stefanols - 02 Dec 2017 at 8:11pm
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: 11 Jan 2018 at 10:04pm
An RSI(2) works as well as Bulkowski's CPI indicator on an index.
The idea is to Buy above the green line only when coming from the opposite red side.
It has a 66% probability of closing in the positive for the following day only.

[Description="RSI with CPI Bulkowski parameters"]
n := input("Time period",2,1);
nb:= n*2-1; {=wilder's smoothing }
Su:=Ma(If(C-Ref(C,-1) > 0, C-Ref(C,-1), 0),nb,E);
Sd:=Ma(If(C-Ref(C,-1) < 0, Ref(C,-1) - C, 0),nb,E);
rs:=100-100/(1 + (Su/sd));
rs;
rs1:=if(rs>=65,rs,65); rs2:=65;
rs3:=if(rs<=36,rs,36); rs4:=36;


[color=lime green; linestyle=dotted]
65;
[color=red]
36;
[name=RSI Top Fill; linestyle=fill; color=blue]
rs1; rs2;
[name=RSI Low Fill; linestyle=fill; color=blue]
rs3; rs4;



Edited by maximo - 11 Jan 2018 at 10:07pm
Back to Top
stefanols View Drop Down
Newbie
Newbie
Avatar

Joined: 29 Jul 2010
Location: Sweden
Posts: 8
Post Options Post Options   Quote stefanols Quote  Post ReplyReply Direct Link To This Post Posted: 14 Jan 2018 at 2:43pm
The visualisation was just what I was looking for.  

Thanks and best regards stefan 
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