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

Re: [amibroker] Background color



PureBytes Links

Trading Reference Links

George

Here is one way you could try...


// background vis a vis MA(c,200);

p = Param("period", 200, 10, 200, 10);
Cond1 = Close > MA(C,p);
Cond2 = Close < MA(C,p);


Plot(C,"", colorWhite, 64);
Plot( MA(C,p),"", IIf(Cond1, colorBlue,IIf(Cond2,colorRed,colorBlack)),1);
Cond1 = Close > MA(C,p);
Cond2 = Close < MA(C,p);

Plot(Param("Height",100,1,100,1),"",IIf(Cond1, 
colorRed,IIf(Cond2,colorBlue,colorBlack) 
),styleArea|styleOwnScale|styleNoTitle|styleNoLabel|styleNoRescale,0,100);

Plot( MA(C,p),"", colorRed,1);
SetChartBkColor(colorBlack);
SetChartOptions(1,0,1);

Use the Param function to adjust the period.
Use the Height Param to adjust from full height to ribbon.
Change the colors to suit.

ChrisB


george_siris wrote:
> 
> 
> Hi all,
> 
> Is it possible to do the following ?
> 
> if condition A then color of chart's background is Red
> if condition B then color of chart's background is Blue
> 
> thanks
> 
> _


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 NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

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/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 
// background vis a vis MA(c,200);

p = Param("period", 200, 10, 200, 10);
Cond1 = Close > MA(C,p);
Cond2 = Close < MA(C,p);


Plot(C,"", colorWhite, 64);
Plot( MA(C,p),"", IIf(Cond1, colorBlue,IIf(Cond2,colorRed,colorBlack)),1);
Cond1 = Close > MA(C,p);
Cond2 = Close < MA(C,p);

Plot(Param("Height",100,1,100,1),"",IIf(Cond1, colorRed,IIf(Cond2,colorBlue,colorBlack)   ),styleArea|styleOwnScale|styleNoTitle|styleNoLabel|styleNoRescale,0,100);

Plot( MA(C,p),"", colorRed,1);
SetChartBkColor(colorBlack);
SetChartOptions(1,0,1);