What is it that you are having trouble with?

Just use the same IIF technique to produce the colors, then use the colors in 
the Plot of the Close. You can use any conditions you like to set the colors. 
EMA is covered in the docs here:

http://www.amibroker.com/guide/afl/afl_view.php?id=44

A more thorough example of working with Plot and colors can be found here:

http://www.amibroker.com/guide/h_indbuilder2.html

Mike

--- In amibroker@yahoogroups.com, Infinity Home Loans <infynh...@...> wrote:
>
> Hi Mike,
> Just need a slight change in the formula you have provided below for afl 
> coding as per bullish / bearish zone.
> I use 5 period EMA's of Highs and Lows to understand the momentum of the 
> market. For trends I actually rely on RSI and avoid getting caught in MA 
> crossovers. 5 period EMA of High / Lows are actually used by me to enter / 
> exit positions.
> Please help me with an afl as per conditions mentioned below:
> 1. If price closes above 5 period EMA of High, then the bar color should be 
> green.2. If price closes below 5 period EMA of Lows, then the bar color 
> should be red.3. If price close is between both these EMA's, then the bar 
> color should be black.
> ThanksMithil
> 
> --- On Tue, 8/6/10, Mike <sfclimb...@...> wrote:
> 
> From: Mike <sfclimb...@...>
> Subject: [amibroker] Re: Request  Is there any afl greencolor for bullish 
> zone and red for bearish
> To: amibroker@yahoogroups.com
> Date: Tuesday, 8 June, 2010, 1:08 PM
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
>  
>  
> 
> 
> 
>   
> 
> 
>     
>       
>       
>       Upgrade to the latest version, otherwise remove the last 2 arguments. 
> But, if you are not using the latest, then you may find that the background 
> covers the chart grid and vertical selection lines.
> 
> 
> 
> Mike
> 
> 
> 
> --- In amibroker@yahoogroups.com, subhajit mukherjee <teacher.com_2003@> 
> wrote:
> 
> >
> 
> > it is giving an error in the last line stating too many parameters
> 
> > 
> 
> > subhajit mukherjee
> 
> > 
> 
> > --- On Sat, 5/6/10, ram vel <rvlv@> wrote:
> 
> > 
> 
> > From: ram vel <rvlv@>
> 
> > Subject: Re: [amibroker] Re: Request  Is there any afl greencolor for 
> > bullish zone and red for bearish
> 
> > To: amibroker@yahoogroups.com
> 
> > Date: Saturday, 5 June, 2010, 3:55 PM
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> > 
> 
> >  
> 
> > 
> 
> > 
> 
> > 
> 
> >   
> 
> > 
> 
> > 
> 
> >     
> 
> >       
> 
> >       
> 
> >       Dear Mike
> 
> > Thank you and really appreciate your fast response.
> 
> > real nice of you
> 
> > regards
> 
> > rv
> 
> > 
> 
> > --- On Sat, 6/5/10, Mike <sfclimb...@yahoo. com> wrote:
> 
> > 
> 
> > 
> 
> > From: Mike <sfclimb...@yahoo. com>
> 
> > Subject: [amibroker] Re: Request Is there any afl greencolor for bullish 
> > zone and red for bearish
> 
> > To: amibro...@yahoogrou ps.com
> 
> > Date: Saturday, June 5, 2010, 1:26 AM
> 
> > 
> 
> > 
> 
> >   
> 
> > 
> 
> > 
> 
> > Here's one way to do it. Substitute your own definition of trend.
> 
> > 
> 
> > Fast = MA(Close, 5); 
> 
> > Medium = MA(Close,
> 
> >  25); 
> 
> > Slow = MA(Close, 50); 
> 
> > 
> 
> > Plot(Close, "Price", colorBlack, styleBar); 
> 
> > Plot(Fast, "Fast", colorDarkGreen, styleLine); 
> 
> > Plot(Medium, "Medium", colorYellow, styleLine); 
> 
> > Plot(Slow, "Slow", colorDarkRed,
> 
> >  styleLine); 
> 
> > 
> 
> > UpTrend = Fast > Medium && Medium > Slow; 
> 
> > DnTrend = Fast < Medium && Medium < Slow; 
> 
> > Colors = IIF(UpTrend, colorGreen, IIF(DnTrend, colorRed, colorLightGrey)); 
> 
> > 
> 
> > Plot(1, "", Colors, styleOwnScale | styleArea | styleNoLabel, 0, 1, 0, -1);
> 
> > 
> 
> > 
> 
> > Mike
> 
> > 
> 
> > --- In amibro...@yahoogrou ps.com, "rvlv" <rvlv@> wrote:
> 
> > >
> 
> > > 
> 
> > > Hi experts
> 
> > > 
> 
> > > I remember having seen an afl
> 
> > > the chartspace is showing green color while price is uptrend and the 
> > > chart area gets red color if price becomes downtrend, and area gets ash 
> > > or grey color if price bars have no trend
> 
> > > 
> 
> > > I am talking of chart area from top to bottom
> 
> > > 
> 
> > > thanks for help
> 
> > > regards
> 
> > > rv
> 
> > >
> 
> >
>


Reply via email to