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

Using IIf to assign styles based on groupid



PureBytes Links

Trading Reference Links

This is my first attempt in a long time to modify my Amibroker charts 
using AFL, so please excuse the ignorance.

I want to use candlesticks for my groups that have OHLC data and a 
dotted line for the groups with Close only data (mutual funds) on a 
chart which is to have price overlain with another plot. Since I 
don't think it is yet possible to add custom plots to the default 
price chart, I've been trying to use various combinations of code to 
accomplish this. Here's what I have tried so far ...

IIf(GroupID() == 3 OR GroupID() == 4, Plot( Close, "Date "+Date() 
+ ", Close", colorDarkGreen, styleCandle),Plot( Close, "Date "+Date
() + ", Close", colorBlack, styleDots | styleThick));

This causes both the line and candlesticks to be drawn.

Plot( Close, "Close", colorDarkGreen, IIf(GroupID()==3 OR GroupID()
==4, styleCandle, styleDots ));

This results in a "bad argument" error message.

MaxGraph = 1;
Graph0 = Close;
Graph0Color = colorDarkGreen;
Graph0Style = IIf(GroupID()==3 OR GroupID()==4, 
styleCandle ,styleDots) | styleThick;

This results in a thin dark green line, i.e. it looks like the 
Graph0Style line is not being read at all.

I would appreciate anyone's kind assistance.