[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [amibroker] Re: Sector Trading (was Metastock...)



PureBytes Links

Trading Reference Links

Now, if you dont mind to add two more lines, you may have a more 
independent code and select the colors you prefer.

y=CCI(20);
Cond1=y>0;
Cond2=y<0;
firstbars=Param("f",5,3,10,1);
Cond11=cond1*(BarsSince(Cond2)<=firstbars);
Cond111=cond1*(BarsSince(Cond2)>firstbars);
Cond22=cond2*(BarsSince(Cond1)<=firstbars);
Cond222=cond2*(BarsSince(Cond1)>firstbars);
Color=
Cond11*colorBrightGreen+Cond111*colorGreen+
Cond22*colorRed+Cond222*colorDarkRed;
Plot(y,"y",Color,2);

Replace above colorRed etc with your preference. Play with param for 
the final visual part.
Dimitris Tsokakis
--- In amibroker@xxxxxxxxxxxxxxx, "DIMITRIS TSOKAKIS" <TSOKAKIS@xxxx> 
wrote:
> Dennis,
> the following will give you different color for the first 5 positive
> [or negative] days
> y=CCI(20);
> Cond1=y>0;Cond2=y<0;
> Cond11=cond1*(BarsSince(Cond2)<=5);
> Cond22=cond2*(BarsSince(Cond1)<=5);
> Color=Cond1*24+Cond2*43+Cond11+Cond22;
> Plot(y,"y",Color,2);
> Dimitris Tsokakis
> --- In amibroker@xxxxxxxxxxxxxxx, "theoldchartreader" 
> <theoldchartreader@xxxx> wrote:
> > Hi,
> > This is what I am using , this gives me a green and red histogram 
> > above and below the zero line.
> > What I would like to add is a different color bars, for the first 
5 
> > days above and below the zero line.
> > 
> > 
> > paint = IIf(CCI(20)>0, colorGreen, colorRed) ; 
> > 
> > Plot(CCI(20), "Cci", paint, styleHistogram); 
> > 
> > 
> > Thank you,
> > Dennis



Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/amibroker/

<*> To unsubscribe from this group, send an email to:
     amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
     http://docs.yahoo.com/info/terms/