Hi Johan,

This is an outstanding piece of coding.  Thank you for sharing.  It is nice to see how advanced functions and new features implemented in code in innovative ways.   I do have one question though after putting your indicator on a sheet along with my version of the ribbon, MACD, and RSI.  I noticed that when you lay down the vertical selector bar, this vertical bar is centered in the bars of my ribbon indicator, but on the edge of your indicator.

I have looked but can not figure out why this is so.  And in some cases (like the attached BDK) the signals will be missed because your ribbon doesn't plot it.

Check out the inserted chart below (and attached chart).

Dave
MM



-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of johsun
Sent: Friday, July 28, 2006 10:30 AM
To: [email protected]
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

<*> 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/



Attachment: BDK 7-28-06 Daily with Ribbons.png
Description: PNG image

Reply via email to