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

[amibroker] Colored Lines



PureBytes Links

Trading Reference Links

Hi,

I took a piece of code I found in the AFL library and modified it to
add coloring.  For some reason something doesn't work right.

The code is the following:

---------------------------------------

WeekH = TimeFrameGetPrice("H", inWeekly, -1);
WeekL = TimeFrameGetPrice("L", inWeekly, -1);
WeekC = TimeFrameGetPrice("C", inWeekly, -1);
WeekO = TimeFrameGetPrice("O", inWeekly);

PP = (WeekH + WeekL + WeekO + WeekO) / 4 ;

Plot(PP, "",IIf(PP >Ref(PP,-1),colorBrightGreen,           
IIf(PP<Ref(PP,-1),colorDarkRed,colorWhite)),styleDots+styleNoLabel);

-------------------------------------------

The line changes from red to green and visa versa depending if the
weekly pivot is higher (or lower) than last week's pivot.  But the
dotted line (which is the actual pivot) doesn't hold the green or red
color. The "colorwhite" was added just to complete the IIF statement.

The pivot should be either red or green.

Thanks in advance

Costas