guru_trader 485 posts msg #110307 - Ignore guru_trader modified |
1/18/2013 2:25:47 AM
While working on this filter, I discovered a few issues -- some related to your request and some related to Stockfetcher.
LEGEND: "up" = ( close > open )"; "down" = ( close < open ); "flat" = ( close = open ); SYM is the abbreviation for any symbol
First, there are several combinations of scenarios that need clarification. How should the following be treated?
SPY.....SYM
up........up = both up
up........down = both not up
up........flat = both up? both not up? both not up or down?
down........up = both not up
down........down = both down
down........flat = both down? both not down? both not down or up?
flat..........up = both up? both not up? both not up or down?
flat..........down = both down? both not down? both not down or up?
flat..........flat = both up? both down? both not up or down? both equal to 0?
You see, we could, at least, add another category equal to both being flat, but that seems like a rare event (only 2 days in the last 100 for SPY). It's more likely that either SPY or SYM will, independently, be flat while the other closes up or down. Alternatively, the flat days could be lumped into the "up" (or "down") category. So, how should those be handled?
Another, potentially bigger, problem is Stockfetcher not returning the expected value for sym_up (close>open), sym_dn (close
In theory, there should be no such day in which all of these conditions added together is greater than 1 ... (close > open) and/or (close < open) and/or (close = open). (I had to add paragraphs because, for some reason, the Stockfetcher forum is chopping up my post and omitting parts).
However, Stockfetcher is reporting about 20-30 symbols equal to 2 -- sort column "sum_sym" descending and see for yourself. That "bug" (or "quirk", or "feature") will negate some of our efforts to properly categorize up, down, and flat days.
Anyway, here is the uncluttered version ...
Here is the full ("cluttered") version, for viewing the "bug" (or "quirk", or "feature") in Stockfetcher ... see the column labeled, "sum_sym" ... I don't think it should include any values greater than 1, but it does.
This got me thinking -- this sounds a lot like correlation studies. Here are some correlation studies (using a lot less code) to investigate:
You'll notice that the order of symbols is about the same on both filters ... as expected.
|