PureBytes Links
Trading Reference Links
|
Hi, hoping someone can chime in on this basic line plot question. I seem to be having a lot of basic plotting problems lately, on stuff that I am sure should work.
In this case, all I want to do is draw a line between the current Close and the Low of 5 bars ago, if the current Close is lower than that Low.
This is what I have, but the lines do not plot. I'm also wondering if I even need to use looping for this or if I can do it without loops. Any input appreciated:
SetChartOptions(0, chartShowArrows|chartShowDates);
_N(Title = StrFormat("{{INTERVAL}} {{DATE}} \n{{VALUES}}",
O, H, L, C, V, SelectedValue(ROC(C, 1)) ));
Plot(C, "Close", colorBlack, styleThick|styleDots);
Plot(H, "High", colorBlue, styleLine);
Plot(L, "Low", colorRed, styleLine);
// Any time that the current Close is lower than the *Low* of 5 bars ago, then plot a
// red dashed line between those two prices.
fb = Max(Status("firstVisibleBar"), 5);
lb = Status("lastVisibleBar");
Low5 = Ref(L, -5);
LineLow = Null;
for ( i = fb; i < lb; i++ )
{
if( C[i] < Low5[i] )
{
LLow = LineArray(i, C[i], i-5, Low5[i] );
LineLow = IIf(!IsNull(LLow), LLow, LineLow);
}
}
Plot(LineLow, "LineLow", colorRed, styleDashed);
__._,_.___
**** IMPORTANT ****
This group is for the discussion between users only.
This is *NOT* technical support channel.
*********************
TO GET TECHNICAL 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
*********************************
__,_._,___
|