PureBytes Links
Trading Reference Links
|
Hi,
I am trying to find out the value of a previous peak. For simplicity I have
started out with the zig-zag based PeakBars() function. I construct an array
with booleans indicating if a bar is a peak or not and another array
indicating the corresponding peak value:
percentChange = 1;
isPeak = PeakBars(H, percentChange) == 0;
peakValue = ValueWhen(isPeak == 1, H);
So far everything is fine. My problem is now that I would like to know the
value of and number of bars since a previous peak. This previous peak should
be the first one backwards in time with a higher High than the current peak.
I would use this information to plot trend lines.
I have made attempts at solving this with looping, but it seems like quite
time consuming to scan backwards and forth through the arrays to construct
the needed arrays. So my question is: is there a way to do this with some
handy array based functions?
Any hints would be highly appreciated!
/Martin
------------------------ Yahoo! Groups Sponsor --------------------~-->
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/
|