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

[amibroker] Re: TD Lines



PureBytes Links

Trading Reference Links

Hi,

after rereading your post several times I'm still not sure I'm 
getting it, but here's how I interpret it:

If a demandline on the day after the most recent pivotlow is higher 
than the close, then this pivotlow (the most recent) should not be 
regarded a pivotlow, - and that this should result in not just 
refraining from plotting the demandline, but retaining the previous 
one. (phew!)

If this is correct then I think I'm unable to help you, too 
difficult for me! Guess you're on your own now :) - well not on your 
own, plenty of skilled people on this board, I'm sure someone will 
work it out if you can't do it yourself.

Regards 
Johan






--- In amibroker@xxxxxxxxxxxxxxx, "marmal417" <marmal@xxxx> wrote:
> Hi Johan,
> 
> it's really two different things. The first was the arrows, which 
you 
> fixed. 
> The second is a matter of validating points. Let's say that you 
have 
> two pivot low points that you connect with a demand line. As it 
turns 
> out the close of the bar immediately after the most recent pivot 
> point is below the trendline. You can see what problem this 
creates? 
> If the stock opens unchanged the next day it will break the 
> trendline. It has to gap up on the open to avoid this. Therefore, 
if 
> the close the day after the most recent pivot low is below the 
> trendline that would be drawn, then the pivotpoint is 
disqualified, 
> and the line between the two previous pivot points is kept. Hope 
you 
> understand. I have a vague idea on how to do it, but haven't tried 
it 
> yet.
> By the way, here is the code I use now:
> 
> Plot(C,"",colorBlack,styleBar);
> pivothigh = Ref(C,-3)<H AND Ref(H,-2)<H AND Ref(H,-1)<H AND H>=Ref
> (H,1);
> pivotlow = Ref(C,-3)>L AND Ref(L,-2)>L AND Ref(L,-1)>L AND L<=Ref
> (L,1);
> 
> x1=LastValue(ValueWhen(pivotlow,Cum(1)-1,1));
> y1=LastValue(ValueWhen(pivotlow,L,1));
> x0=LastValue(ValueWhen(pivotlow AND L<y1,Cum(1)-1,1));
> y0=LastValue(ValueWhen(pivotlow AND L<y1,L,1));
> x3=LastValue(ValueWhen(pivothigh,Cum(1)-1,1));
> y3=LastValue(ValueWhen(pivothigh,H,1));
> x2=LastValue(ValueWhen(pivothigh AND H>y3,Cum(1)-1,1));
> y2=LastValue(ValueWhen(pivothigh AND H>y3,H,1));
> 
> supplyline=IIf(x2==0,Null,LineArray(x2,y2,x3,y3,1));
> Plot(supplyline,"",colorRed,styleLine|styleThick|
> styleNoRescale|styleNoLabel);
> demandLine=IIf(x0==0,Null,LineArray(x0,y0,x1,y1,1));
> Plot(demandLine,"",colorBlue,styleLine|
> styleThick|styleNoRescale|styleNoLabel);
> 
> PlotShapes((Cum(1)-1==x0 OR Cum(1)-1==x1)
> *shapeSmallCircle,colorBlue,0,L);
> PlotShapes((Cross(Cum(L<demandLine AND Cum(1)-2>x1),0))
> *shapeDownArrow,colorRed,0,H);
> PlotShapes((Cum(1)-1==x2 OR Cum(1)-1==x3)
> *shapeSmallCircle,colorRed,0,H,12);
> PlotShapes((Cross(Cum(H>supplyline AND Cum(1)-2>x3),0))
> *shapeUpArrow,colorGreen,0,L);
> 
> Title= Name()+" "+Date()+EncodeColor(colorBlack) +" Open-"+WriteVal
> (Open)+" Hi-"+WriteVal(High)+" Lo-"+WriteVal(Low)+" Close-
"+WriteVal
> (Close) +EncodeColor(colorRed)+" supply line "+WriteVal(supplyline)
> +EncodeColor(colorBlue)+" demand line "+WriteVal(DEMAndline)
> +EncodeColor(colorRed)+"\n potential Buy "+WriteVal((y3-y2)/(x3-x2)
> +LastValue(supplyline))+EncodeColor(colorBlue)+" potential 
> Sell "+WriteVal((y1-y0)/(x1-x0)+LastValue(DEMAndline));
> GraphXSpace=6;




Send BUG REPORTS to bugs@xxxxxxxxxxxxx
Send SUGGESTIONS to suggest@xxxxxxxxxxxxx
-----------------------------------------
Post AmiQuote-related messages ONLY to: amiquote@xxxxxxxxxxxxxxx 
(Web page: http://groups.yahoo.com/group/amiquote/messages/)
--------------------------------------------
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/