hraghav 12 posts msg #63424 - Ignore hraghav |
6/6/2008 5:35:41 AM
I am doing some study on TRO's RFR filter (Thanks, TRO!)
How do I do this:
set{x1, high - open} OK
set{Long_Profit, x1/open }
I want to find the highest Long_Profit in the last 100 days. It fails if I try this:
set{max_prof, max(Long_Profit, 100)}
as max only takes two indicators max(ind1, ind2). I want max to take (ind1, LENGTH). Any ideas how this could be done?
|
nikoschopen 2,824 posts msg #63434 - Ignore nikoschopen |
6/6/2008 12:39:39 PM
|
hraghav 12 posts msg #63440 - Ignore hraghav |
6/6/2008 3:24:41 PM
Niko:
Thanks again! You da, man!
|
nikoschopen 2,824 posts msg #63441 - Ignore nikoschopen modified |
6/6/2008 5:42:51 PM
No problem. Since ure dealing with %, rather than $, the following might be a little easier on the eyes. Also note that the column labeled Dayz (MaxProfit%) will tell you when the "MaxProfit%" occured.
In addition, you might want to consider what the drawdown might have been had you unfortunately missed the chance to unload ure position at the "exact" high of the day. Basically what ure looking for is the ratio between the possible Long (High - Open) and the possible Short (Open - Low). A ratio of 1 or higher would suggest that the Long had a wider range than the Short play. A ratio less than 1 would suggest that the Short had the upper hand for the day.
Although I do not wish to demean anyone in particular, I believe the so-called "Stat" filter offered so far is too simplistic. It tends to give only one-sided view without taking into account the "what if" scenario. The above example is just a scratch on the tip of the iceburg. We could go much further by analyzing, for example, what the range (High - Open) is when the stock closed down on the prior day versus when it closed up on the prior day. The reason is that when the stock closes up for the day, it tends to continue at the open on the next day.
|
hraghav 12 posts msg #63442 - Ignore hraghav |
6/6/2008 6:04:34 PM
Niko:
You pretty much nailed it! :) I am pretty much analyzing along the same lines -- thanks to TRO's original Stat scan that piqued my interest. But as you said, I'm throwing all kinds of what-if and other stats at it. I will share the results with the forum folks once I have something concrete.
|
hraghav 12 posts msg #63445 - Ignore hraghav |
6/6/2008 6:47:30 PM
Niko:
Why does the days(...) return -1 or 0 in the above forumla? What does it signify? Does it signify that today was the Max_Profit and days(...) formula is unable to handle it?
|
nikoschopen 2,824 posts msg #63449 - Ignore nikoschopen |
6/6/2008 8:39:16 PM
I would think "0" means that the occurrence took place today, but I have no idea what "-1" means. Sorry!
|
chetron 2,817 posts msg #63451 - Ignore chetron modified |
6/6/2008 8:45:44 PM
i believe -1 means:
it did not occur today
it did not occur yesterday
but it could possibly occur sometime in the distant future, or very very soon.
sorry, i am watching monty python. lol.
very nice work on these filters, niko.
|
nikoschopen 2,824 posts msg #63452 - Ignore nikoschopen modified |
6/6/2008 8:49:02 PM
Quote from hraghav:
But as you said, I'm throwing all kinds of what-if and other stats at it. I will share the results with the forum folks once I have something concrete.
Monsieur TRO is fond of finding how many times a stock makes 5-cents or more within the last 100 days. Well, the problem is that you never quite know for sure whether the stock will go up at the open. Sometimes, it stumbles out of the gate and actually falls before reversing and heading higher. My point is that there are many "if-then" scenarios that can be applied to the filter that in the end you would be left with essentially a different filter. Let me know if I can be of any further help.
|