PureBytes Links
Trading Reference Links
|
I replied re the use of the Median function.
You could, of course, sum the 4 peaks and the 4 troughs to get their
average, but that doesn't get the elusive median that you seek.
You could grab the 8 points in a for loop and then Bubble sort them if
you must.
Regards,
Bob
-----Original Message-----
From: conn_dennis [mailto:dennisconn@xxxxxxxxxxxxxxxx]
Sent: Friday, November 05, 2004 12:26 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: median calculation
So was the question that stupid, or hasn't anyone ever attempted it?
Anyone???
--- In amibroker@xxxxxxxxxxxxxxx, "conn_dennis" <dennisconn@xxxx>
wrote:
>
> I know that the median function will return the median value of the
> entire array, but how would one go about finding the median of only
> some of the values in an array?
>
> So far, I've managed only to identify the peaks in an oscillator
I've
> coded, but I'm trying to have the program find the median of ONLY
the
> four highest peaks within a user-defined lookback range (likewise
> with the four lowest troughs below zero).
>
> I think I can stumble around and figure out how to code what I need
> once I get past this median problem. I've spent two days on this
> trying to figure it out (I feel like Thomas Edison - I've
discovered
> a thousand ways to NOT find the median). : )
>
> Has anyone had a similar problem and found a somewhat simple
> solution, or perhaps be willing to point me in some direction?
>
> DC
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
------------------------ 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/
|