Johan...Thanks.  IMHO, this routine is a thing of beauty!

Short, flexible and exploits TJ's function code in a way that reminds me of 
how Dimitris T
would do this many moons ago when he still published on this forum.  He may 
still be doing it for
all that I know.   His code, as you'll recall was "dense" if that's the 
right word, somewhat like this routine, got
a lot of function out of a lot in a few lines but in Dimitris' case he 
packed 2, 3 lines in 1 line plus he liked to use
one letter variable names.  Beggars can't be choosers but I like the way 
you've laid this out and labeled the variables.

You've done it in ways this plodder had no idea could be done.

Best regards.
JOE


----- Original Message ----- 
From: "johsun" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Friday, July 28, 2006 12:30 PM
Subject: [amibroker] Re: Multi Row Colored Ribbons


> Using styleCloud you can create a procedure to add as many ribbon
> indicators as you like in a pane.
> I came up with this:
>
>
>
>
>
>
> SetBarsRequired( 10000, 0 );
> GraphXSpace = 0;
> Title = "";
>
> procedure ribbon( ribbon_nr, Caption, Color ) {
>
>  firstbar = Status( "firstvisiblebarindex" );
>  lastbar = Status( "lastvisiblebarindex" );
>
>  xOffset = ( lastbar - firstbar ) / 100;
>  yOffset = 0.5;
>
>  y2 = ribbon_nr;
>  y1 = y2 - 1;
>
>  Plot( y2, "", colorBlack, styleLine | styleNoLabel );
>  PlotOHLC( 0, y2, y1, 0, "", Color, styleCloud | styleNoLabel );
>  PlotText( Caption, firstbar + xOffset, y2 - yOffset, colorBlack );
>
> }
>
> colorRSI = IIf( RSI() > 70, colorRed, IIf( RSI() < 30,
> colorGreen, colorYellow ) );
>
> colorMACD = IIf( MACD() > Signal(), colorGreen, colorRed );
>
> ribbon( 1, "RSI-14", colorRSI );
> ribbon( 2, "MACD", colorMACD );
>
>
> /*
> add ribbons to your liking just increase the count for each one.
>
> ribbon( 3, "MA20", IIf( C > MA( C, 20 ), colorGreen, colorRed ) );
> */
>
>
>
>
> Regards
> Johan
>
>
>
>
>
> --- In [email protected], "Wayne Kroutil" <[EMAIL PROTECTED]>
> wrote:
>>
>> All---Question?  When I try to plot only RSI and MACD, I lose the
> titles for
>> all 4 ribbons.  I only want titles on two.  How can the AFL be
> changed to do
>> this?
>>
>> Thanks
>>
>> Wayne
>>
>
>
>
>
>
>
> Please note that this group is for discussion between users only.
>
> To get support from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
>
> Yahoo! Groups Links
>
>
>
>
>
>
>
> 




Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to 
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.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:
    [EMAIL PROTECTED]

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



Reply via email to