PureBytes Links
Trading Reference Links
|
hopefully a quick question.. now that I think I've figured out how the
array processing work(after a 2+hours of playing :) ....the following
code finds triangular formations and draws them out as long as Rate of
change is greater than 20 and reversal of at least 5. I converted this
code from a S&C article and they supplied a wealth-lab script which
was interesting.
Question : when using Linearray, is there a way to extend the line
only for a specified number of bars?
AmiCode
Plot( Close, "Price", colorBlack, styleCandle );
Reversal = 5;
p1 = Peak( High, Reversal, 1);
pb1 = PeakBars(High, Reversal ,1);
p2 = Peak( High, Reversal, 2);
pb2 = PeakBars(High, Reversal, 2);
t1 = Trough( Low, Reversal, 1);
t2 = Trough( Low, Reversal, 2);
t3 = Trough( Low, Reversal, 3);
tb1 = TroughBars( Low, Reversal, 1);
tb2 = TroughBars( Low, Reversal, 2);
tb3 = TroughBars( Low, Reversal, 3);
ratec = ROC(Close,60);
temp2 = 0;
total = 200;
temp = 0;
counter = 0;
while(total<BarCount-1)
{
p2a = p2[total] * .995;
t2a = t2 * 1.005;
t3a = t3 * 1.005;
if ( p1[total]<p2a[total] )
if ( t1[total]>t2a[total] )
if (t2[total]>t3a[total])
if (total-pb2[total]>total-tb3[total])
if (total-tb2[total]>total-pb2[total])
if (total-pb1[total]>total-tb2[total])
if(total-tb1[total]>total-pb1[total])
if (ratec[total] > 20 )
{
++counter;
Plot(LineArray(total-pb2[total],p2[total],total-tb2[total],t2[total],0),"",colorBlue,2052);
Plot(LineArray(total-tb2[total],t2[total],total-pb1[total],p1[total],0),"L2",colorBlue,2052);
Plot(LineArray(total-pb1[total],p1[total],total-tb1[total],t1[total],0),"L3",colorBlue,2052);
Plot(LineArray(total-tb3[total],t3[total],total-pb2[total],p2[total],0),"L4",colorBlue,2052);
Plot(LineArray(total-pb2[total],p2[total],total-pb1[total],p1[total],0),"L5",colorRed,2052);
Plot(LineArray(total-tb2[total],t2[total],total-tb1[total],t1[total],0),"",colorRed,2052);
}
++total;
};
------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for your HP, Epson, Canon or Lexmark
Printer at MyInks.com. Free s/h on orders $50 or more to the US & Canada.
http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/mOAaAA/3exGAA/qnsNAA/GHeqlB/TM
---------------------------------------------------------------------~->
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/
|