Gordon,

Thanks for taking the time to provide such a detailed answer with the
attached code and chart. You have provided the last problem to my original
code and that is automatic vertical positioning of the ribbon level text.
Terry and Johan provided two great solutions to the horizontal positioning.
Combining all of these suggestions will make for an outstanding multi
purpose indicator.

You guys are great contributors to this group!

FWIW, I haven't ventured into systems development just yet. This idea is a
carry over on some things I did with indicators for the Radar Screen in
TradeStation.  My concept is to pack as many indicators into ribbons as
possible for a whole bunch of reasons.

Trade well,

Dave
MM

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf
Of Gordon Sutherland
Sent: Sunday, July 30, 2006 4:36 PM
To: [email protected]
Subject: Re: [amibroker] Re: Multi Row Colored Ribbons


Hi Dave,

Below is my parameter 'tweaked' copy of Johan's code (removing StyeCloud to
avoid the 1 bar deday problem). I plot this AFL file as a separate pane to
the Price Plot for clarity. As I suspect with you, I find multi-ribbons an
invaluable method of checking the synergy of my indicators/signals for
systems development - not just pretty pictures!
The addition of text in the ribbons avoids me having to write messy lines of
code in the Title to clarify what each ribbon represents.

The parameters I added in the AFL file allow you to align the ribbon text to
the centre of the respective ribbon which helps if you adjust the size of
the Pane or the depth of the ribbons (what I called 'verticality'). As I
said in my previous post, Johan's code is 'slick, real slick'.

Watch out for the usual word-wrap in the lines of code below or better still
use the AFL file attached.

Regards,
Gordon  Sutherland

_SECTION_BEGIN("Ribbons with Text");
// Main coding by Johsun on [email protected] 29th July 2006 //
Initial idea and Thread by Dave Littner (MarketMonk) // Ribbon(s) with Text
(Parameter adjustable vertical positioning by Gordon Sutherland [GBS]) //
Additional comments by GBS to Johsun's code remarked with [GBS] // HINT: Use
in a separate pane because price plots are hard to read over the colored
ribbons [GBS]

SetBarsRequired( 10000, 0 ); // This line required to avoid the Ribbon Text
disappearing off screen (to Barcount(1) [GBS] GraphXSpace = Param("Set
Ribbon(s) Depth",10,0,50,1); // Makes space at top of Pane for a Title GBS
Title = "Ribbon Title Here"; // This line eliminates the default Title text
at the top right of the Pane if set as "" [GBS]

procedure ribbon( ribbon_nr, Caption, Color ) {

   firstbar = Status( "firstvisiblebarindex" );
   lastbar = Status( "lastvisiblebarindex" );

   xOffset = ( lastbar - firstbar ) / 100;
   yOffset = Param("Y-Offset 4 Ribbon Text",0.65,0.1,1,.01);

   y2 = ribbon_nr;
   y1 = y2 - 1;
   
   Plot( y2, "", colorBlack, styleLine | styleNoLabel );
   Plot( 0, "", colorBlack, styleNoDraw );
   Plot( y2, "", Color, styleArea | 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 ) ); ribbon(4,
"Avg Vol Up", IIf(MA(V,10) > Ref(MA(V,10),-1),colorLightBlue,colorRed)); //
For illustrative purposes only [GBS] ribbon(5, "Avg Vol Up", IIf(MA(V,10) >
Ref(MA(V,10),-1),colorLightBlue,colorRed)); // For illustrative purposes
only [GBS] ribbon(6, "Avg Vol Up", IIf(MA(V,10) >
Ref(MA(V,10),-1),colorLightBlue,colorRed)); // For illustrative purposes
only [GBS] ribbon(7, "Avg Vol Up", IIf(MA(V,10) >
Ref(MA(V,10),-1),colorLightBlue,colorRed)); // For illustrative purposes
only [GBS] _SECTION_END();



Hi Gordon,

What do you mean by verticality?  Can you post a picture?

Thanks,

Dave
MM 

-----Original Message-----
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Gordon Sutherland
Sent: Friday, July 28, 2006 3:12 PM
To: [email protected]
Subject: RE: [amibroker] Re: Multi Row Colored Ribbons

Johan,

Slick, very slick indeed - especially when you add a couple of
parameters to control verticality.

Thanks,
Gordon  Sutherland
 


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