Need some help again, I would like to write a rule where IT buys when todays close is equal to /less than the 50th percentile of the past 10 days range....
Not sure about the percentile function bit though.....
Size:
Color:
I can help with this if I knew exactly what a 50th percentile price meant with respect to a 10-day range. Can you give an example, please?
Size:
Color:
Take all of the last 10 trading days' closes, rank them high to low and then today's should fall in the bottom 50% of that ranking.
Im just trying to figure out this concept as a trade filter, apologies if it was a bit vague.
Size:
Color:
I don't see what that has to do with the past 10 days'
range, but here's something to work with.
1. Close WLP/D
2.
Download and unzip ALGLIB into the installation folder.
(More info on ALGLIB. I compiled this library without any source modification.)3. Example - a really good one ;)
CODE:
Please log in to see this code.
Interesting note: When
Days Back is divisible by 10, the indicator at 50th percentile equals the Median.Series indicator. (Proof left for homework.)
Size:
Color:
Thanks for that Cone, I think it should have been period, not range....
Size:
Color:
Cone, Took me a while to get back to this but I did, added the following to check it. Thanks again though. just what I needed.
CODE:
Please log in to see this code.
Size:
Color:
Cone, Im trying to add multiple Percentiles. Below is my attempt at adding a second Percentile to the code above. The following code compiles correctly but comes back with a runtime error when I attempt to run it.
CODE:
Please log in to see this code.
Size:
Color:
My script was a demonstration of the capability. If you want to use it as an indicator that you call over and over, you should make a proper indicator out of it, or at least call it as a function like this - (I probably should have done this the first time).
CODE:
Please log in to see this code.
Size:
Color:
Thanks Cone, works a charm!!
Size:
Color:
fwiw I had a need for this calculation as well
I didn't care to use alglib. Got that sandboxing issue again whenever I download a dll from the internet (and I've forgotten how to deal with it. suggestions welcomed)
Here is code that will duplicate Excels Percentile function
CODE:
Please log in to see this code.
Any chance of adding this to the Community Indicators?
Size:
Color:
QUOTE:
Any chance of adding this to the Community Indicators?
Percentile is already present there as part of an indicator (DSR.percentile).
Size:
Color:
I was looking in the indicators for something obvious like Percentile. (Percentile Rank is there)
I see DSR but no DSR Percentile
The help function takes you to a website that describes DSR but doesnt seem to indicate how to get the say, 75th percentile of the past 50 closes. It's not clear to me in the documentation. May I ask you to elaborate?
Thanks
p.s Just plotted the DSR, it appears to give you the current bars percentile relative to the last n bars. What I was looking for is not the current percentile but the value of say, 75th percentile of the last n bars starting at the current bar.
I think it is a different indicator.
Size:
Color:
"DSR.percentile" is not an indicator and has no need to be documented. It's a helper function the DSR is powered by. It calculates percentile of a sorted data set. The code is open source if you wish to learn more on how to use it:
Community Indicators - Download Project Source Code. It's declared as
public for ease of re-use in custom code. I do not claim that it's a solution to your problem.
QUOTE:
Got that sandboxing issue again whenever I download a dll from the internet (and I've forgotten how to deal with it. suggestions welcomed)
1. Open Google, type in "site:wealth-lab.com/Forum/Posts/" nearby your search query (e.g. "sandboxing").
2. Bookmark topics that were useful for you (Topic > Options button > Bookmark) to access them from "My Dashboard" later.
Hope this helps.
Size:
Color:
Thank you Eugene
Size:
Color: