nikoschopen 2,824 posts msg #63586 - Ignore nikoschopen |
6/11/2008 7:05:31 PM
Ever since I've been here, I took not-so-copious notes on interesting codes that I thought were worth preserving. These aren't really filters in and of themselves but are more or less "hacks" (or tricks) that will simplify the filter writing process. Well, most of them came from this addlebrain by way of helping others but there are some very creative ones written by others like Cegis. I thought I take the liberty of sharing these codes with y'all at this point. After all, what good are they elsewhere?
Although no particular importance is placed on the order of appearance, I will start off with some simple codes and then gradually work my way up to the complex over the next few days.
Percent (%) over Dollars ($) | This will spit out the difference in percent (%): This can be also used between any two indicators (eg. "ema(20) above ema(50)") |
---|
Close-to-open gap (or just "gap") | This will spit out how large the gap is for that given day: If you prefer the amount in $ amount: |
---|
| This will find a hammer (hanging man) with a tail that's at least 3/4 of the daily range: Here, two columns labeled "Upper (%)" and "Lower (%)" are added to inform you how large the tail is in relation to the body (OPCL): The following tip allows you to find stocks that have met two conditions in the past. For example, you might be looking for a hammer (condition 1) with a volume spike (condition 2) that occured within the last 5 days:You can readily see when the two conditions occured in the "dayz" column. |
---|
|
nikoschopen 2,824 posts msg #63587 - Ignore nikoschopen |
6/11/2008 7:12:12 PM
BTW feel free to add ure own "hacks".
|
maxreturn 745 posts msg #63590 - Ignore maxreturn |
6/11/2008 8:38:51 PM
I use a 1 year relative strength of a given stock as compared to the SPX in most of my filters:
To return stocks stronger than the SPX over the last year:
To return stocks weaker than SPX:
|
nikoschopen 2,824 posts msg #63592 - Ignore nikoschopen modified |
6/11/2008 10:59:27 PM
Max, thanks for contributing. May I point out, however, one of the things that I find problematic with this filter? I feel that it tells only half the story. We're only given two price points, now (x) and then (y), without any detail on what might have happened between x and y.
Suppose the yearly ROI for S&P and XYZ are -10% and -9%, respectively. Based on these numbers alone, we're led to believe that XYZ is outpacing the general market. What we don't know is that, at one point, XYZ was down more than 30% while S&P was down 15%.
I have no easy answer for this, but could you not include the "yearly high" and the "yearly low" into the equation to get around this problem? Perhaps it could be done in the same way as the Pivot Point: (H + L + C) / 3.
Just my 2¢.
|
nikoschopen 2,824 posts msg #63593 - Ignore nikoschopen |
6/11/2008 11:15:31 PM
|
maxreturn 745 posts msg #63603 - Ignore maxreturn |
6/12/2008 11:44:02 AM
Niko, you're absolutely correct. The weakness of the RS measurement, whether it's 1 year, 6mos, etc, is the volatility of the price swings during that 1 year period. Still, this does not diminish the importance of incorporating RS into your filters. My trading results took a dramatic turn for the better when I focused on buying only high rs stocks during broad market uptrends and selling low rs stocks during broad market downtrends. In summary, all of my filters include rs above 1 for buy candidates and below 1 for sell candidates. The rest of the code in my filters further isolate my ideal candidates. Then it's just a simple matter of eyeballing the charts of the remaining candidates.
|
nikoschopen 2,824 posts msg #63605 - Ignore nikoschopen |
6/12/2008 12:14:29 PM
Howdy,
Note that it wasn't my intention to dispute the importance of utilizing RS in ure trading. I was merely alluding to its weakness that you correctly pointed out.
|
nikoschopen 2,824 posts msg #63613 - Ignore nikoschopen modified |
6/12/2008 7:30:57 PM
Standard deviation for the nonstandard misfits | This will create those unsightly Bollinger Bands around any indicator of ure choice:
Did you know that Bollinger Width is the same as the Standardard Deviation? As such, the Bollinger Width can be used as a substitute for the Standard Deviation indicator:
Here's an imperfect representation of Linear Regression channel that can also be applied to any indicator of ure choice (yeah, this one came up before not too long ago):
Here, you can screen stocks with "My_Indicator" at or near any one of the three Linear Regression channels: |
---|
|
nikoschopen 2,824 posts msg #63677 - Ignore nikoschopen |
6/14/2008 3:30:13 PM
I introduced this hack last Thanksgiving with this to say...
As you may know, the logical disjunction "OR" isn't natively supported in SF language. However, we're able to get by this limitation using the method TRO introduced. I, on the other hand, wish to push this one step further by using it in conjunction with the "If-Then" conditional.
I have noticed that many of you write two filters of the same condition. For example, one filter is written for stocks that crosses above its 20-day moving average and another filter is written for stocks that crosses below its 20-day moving average. Why not just write one filter that would allow both conditions to be met but also informs you which is which. Here's how you write it. | code set{condition 1, count(indicator 1, indicator 2,1) * 1}
set{condition 2, count(indicator 1, indicator 2,1) * -1}
set{both, condition 1 + condition 2}
set{result, 1 - count(both equals 0,1)}
result above 0
add column both{result}
Hence, taking the above example for a 20-day moving average crossover:
And once you run this filter, you will notice in the fifth column either a "1", indicating a bullish crossover, or "-1", indicating a bearish crossover. |
---|
|
tomm1111 202 posts msg #67019 - Ignore tomm1111 modified |
9/6/2008 9:28:37 PM
post deleted by tomm1111 due to posted filter inaccuracies
|