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

[amibroker] Re: Help with Linearray



PureBytes Links

Trading Reference Links


// Calculate the pivot range:
PivotBand = abs(Avg - (H+L)/2);
VaH = Avg + PivotBand;
VaL = Avg - PivotBand;
MONDAY=DayOfWeek()==1;
BAR=LastValue(ValueWhen(MONDAY,Cum(1)));
Lu=ValueWhen(MONDAY,VaH);
Plot(IIf(Cum(1)>=BAR,Lu,Null),"LU",colorBlack,styleLine);
Plot(C,"C",1,64);


--- In amibroker@xxxxxxxxxxxxxxx, "Herbert Elstein" <herty@xxxx> 
wrote:
> Hi,
> What looked like a simple code got me trying all sorts of ingenious 
> but ineffective codes.
> 
> I'm trying to draw lines from a pivot area top and bottom on the 
> latest Monday,(I'll show only the top line) but only extending to 
> the right on subsequent days.
> 
> The following code is correct but the line extends across the whole 
> chart, which is not what I want.
> 
> // Calculate the pivot range:
> PivotBand = abs(Avg - (H+L)/2);
> VaH = Avg + PivotBand;
> VaL = Avg - PivotBand;
> Lu=LastValue(ValueWhen((DayOfWeek()==1),VaH));
> Plot(Lu,"",colorBlack,styleLine);
> 
> So I tried the following code but it still displays the line across 
the whole chart. So where am I off course? Or is this approach not 
feasible?
> 
> 
> yu0=Lu;
> 
> yu1=Lu;
> 
> xu0=LastValue(ValueWhen(Lu,BarIndex(),1)); 
> 
> xu1=xu0 + 1;
> 
> pu=LineArray(xu0,yu0,xu1,yu1,2); 
> 
> Plot(Lu,"",colorBlack,styleLine);
> 
> Thanks for the tackle,
> Herbert
> 
> 
> 
> [Non-text portions of this message have been removed]





------------------------ Yahoo! Groups Sponsor --------------------~--> 
$9.95 domain names from Yahoo!. Register anything.
http://us.click.yahoo.com/J8kdrA/y20IAA/yQLSAA/GHeqlB/TM
--------------------------------------------------------------------~-> 

Check AmiBroker web page at:
http://www.amibroker.com/

Check group FAQ at: http://groups.yahoo.com/group/amibroker/files/groupfaq.html 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> 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/