Amibroker Multiple Timeframe

M

malaguti

I don't suppose anybody with a little more experience with Amibroker AFL experience could help me?
I've managed to plot a weekly CCI as an indicator on a daily chart by using the guides..but now I want to colour the bars using an IIF function, so that when the weekly CCI is greater than 100, to plot green, and red when greater than -100. These are to be plotted on the daily chart. I've managed to code this when only working in the daily timeframe but there's little help when combining the two..here's where I've got to..


TimeFrameSet(inWeekly);
CCIW = CCI(20);
TimeFrameRestore();

Plot (TimeFrameExpand (CCIW, inWeekly), "CCI weekly", IIf (CCIW, inWeekly > 100), colorGreen, colorBlack, styleHistogram);

could somebody tell me where im going wrong or suggest an alternative?

Thanks
 
use this
ccicolor = iif(cross(cciw ,100),colorgreen,iif(cross(cciw,-100),colorred,colorgrey50));
Plot (TimeFrameExpand (CCIW, inWeekly), "CCI weekly", ccicolor, styleHistogram);
=======================


I don't suppose anybody with a little more experience with Amibroker AFL experience could help me?
I've managed to plot a weekly CCI as an indicator on a daily chart by using the guides..but now I want to colour the bars using an IIF function, so that when the weekly CCI is greater than 100, to plot green, and red when greater than -100. These are to be plotted on the daily chart. I've managed to code this when only working in the daily timeframe but there's little help when combining the two..here's where I've got to..


TimeFrameSet(inWeekly);
CCIW = CCI(20);
TimeFrameRestore();

Plot (TimeFrameExpand (CCIW, inWeekly), "CCI weekly", IIf (CCIW, inWeekly > 100), colorGreen, colorBlack, styleHistogram);

could somebody tell me where im going wrong or suggest an alternative?

Thanks
 
Top