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

[amibroker] Re: Multi Row Colored Ribbons



PureBytes Links

Trading Reference Links

Dave this is what I use to color my indicator dynamicly. I got it 
from the help files.

Long_color = up; //"up" is your variable.
Short_color =  down; //daown is your variable too.
dynamic_color = IIf(Long_color, colorGreen , IIf(Short_color, 
colorRed , colorBlue)) ;

Plot( MACD()  , "MACD" , dynamic_color , ParamStyle ("Style" , 
styleNoLabel| styleThick ) ); 

hope it helps.

OT

--- In amibroker@xxxxxxxxxxxxxxx, "Corey Saxe" <cesaxe@xxx> wrote:
>
> Try:
> 
> // overall ribbon
> down = MACD()<Signal() AND MA(C,5)<MA(MA(C,5),7);
> up = MACD()>Signal() AND MA(C,5)>MA(MA(C,5),7);
> Color = IIf(down,colorRed,IIf(Up,colorGreen, colorYellow)); 
> //bottom ribbon, plots last
> Plot(2,"Cond1",IIf( MACD()<Signal
(),colorRed,colorGreen),styleOwnScale|styleArea|styleNoLabel,0,100 );
> Plot(2.5,"",colorBlack,styleOwnScale|styleArea|styleNoLabel,0, 
100 );//bottom black line, plots fourth
> 
> // Mid ribbon
> Plot(4.5,"Cond2", IIf( MA(C,5)<MA(MA(C,5),7),
> colorRed, colorGreen), styleOwnScale|styleArea|styleNoLabel, 0, 
100 );//plots third
> Plot(5.0,"",colorBlack,styleOwnScale|styleArea|styleNoLabel, 0, 
100 );//2nd black line, plots second
> 
> 
> Plot(7.5,"Overall Ribbon",Color, 
styleOwnScale|styleArea|styleNoLabel, 0, 100 );//top ribbon, plots 
first
> 
> This was from long ago and doesn't reflect any updated code that 
subsequent betas would have provided.
> 
> -CS
> 
> 
>   ----- Original Message ----- 
>   From: MarketMonk777 
>   To: amibroker@xxxxxxxxxxxxxxx 
>   Sent: Monday, July 24, 2006 12:50 AM
>   Subject: [amibroker] Multi Row Colored Ribbons
> 
> 
>   Hi folks,
> 
>   I have the following code which plots a colored ribbon based on 
a MACD indicator.  This code works well and have attached a picture 
showing how it looks.
> 
>   _SECTION_BEGIN("MACD Color Bar");
> 
>   m = MACD(); 
> 
>   s = Signal(); 
> 
>   MACDColor = IIf( m > s, colorLime, colorLightOrange);
> 
>   Plot( 2, "", MACDColor, styleArea|styleOwnScale|styleNoLabel, 0, 
100);
> 
>   _SECTION_END();
> 
> 
> 
>   What I would like to do is to create multi row ribbons.  Is this 
possible?  I have tried a number of different things without success.
> 
>   Regards,
> 
>   Dave
>