PureBytes Links
Trading Reference Links
|
Hello George,
Actually I had the same problem and I have not found the best
solution to this 'background color' problem.
The solution from ChrisB still has problem with 'range select bar'
(which is the vertical bar in the background when you click on the
chart area), it will not show because he is suggesting to use 'plot'
statement to draw the background color.
Someone suggested to use SetChartBkColor but I wanted to have
gradient color on the background depending on the stock
price/performance, so the gradient goes horizontally from left-right.
There is 'SetChartBkGradientFill' that will set the background color
as gradient 'vertically' not 'horizontally', if you know what I mean.
So far I still don't know what is the best solution for my problem.
Thanks,
Gary.
--- In amibroker@xxxxxxxxxxxxxxx, "george_siris" <george_siris@xxx>
wrote:
>
> Thanks Chris. Exactly what i was looking for
>
>
> --- In amibroker@xxxxxxxxxxxxxxx, ChrisB <kris45mar@> wrote:
> >
> > 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
> > >
> > > _
> >
> > // 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);
> >
>
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/
|