StockFetcher Forums · Filter Exchange · Call me crazy...<< >>Post Follow-up
brank20
41 posts
msg #92758
Ignore brank20
modified
5/14/2010 10:56:36 PM

I just think of all kinds of random ways to measure the performance of a stock, heres one of them. Not sure if it will help anyone or not, nor do I know how well this filter will perform, but here it is anyway. Feel free to adjust the scoring/ranking as you see fit. I plan to incorporate actual performance values into it like how much it outperformed/underperformed versus the index. Right now its strickly did the stock/index close up or down.

Fetcher[ set{pdifc, ind(^INX,close) }
set{pdifo, ind(^INX,open)}
set{pdif, pdifc - pdifo} /*S&P 500 change from open to close*/
set{indexup, count(pdif > 0, 1)} /*Index closed up, true or false*/
set{indexdown, count(pdif < 0, 1)} /*Index closed down, true or false*/
set{pricedif, close - open} /*Stock change from open to close*/
set{stockup, count(pricedif > 0, 1)} /*Stock closed up, true or false*/
set{stockdown, count(pricedif < 0, 1)} /*Stock closed down, true or false*/

/*Identification System - ties a value to each time a stock closes up or down, or an index closes up or down*/
set{stockup1, stockup * 1}
set{stockdown1, stockdown * 2}
set{indexup1, indexup * 4}
set{indexdown1, indexdown * 8}

/*Add all the Identification values up to give us a total sum*/
set{var1, stockup1 + stockdown1}
set{var2, indexup1 + indexdown1}
set{var3, var1 + var2}

/*Identify one of four possible outcomes, index down + stock up, index up + stock up, index down + stock down, index up + stock down over the course of the last 45 days*/
set{idsu, count(var3 equals 9, 45)}
set{iusu, count(var3 equals 5, 45)}
set{idsd, count(var3 equals 10, 45)}
set{iusd, count(var3 equals 6, 45)}

/*Scoring System - If a stock can close up, when a major index is closed down, it scores 3 points*/
set{var4, idsu * 3}
/*Scoring System - If a stock can close up, when a major index is closed up, it scores 2 points for consistency*/
set{var5, iusu * 2}
/*Scoring System - If a stock can close down, when a major index is closed down, it scores 1 points for consistency*/
set{var6, idsd * 1}
/*Scoring System - If a stock closes down, when a major index is closed up, it scores 0 points for negatively closing against an up day on the index*/
set{var7, iusd * 0}

set{var8, var4 + var5}
set{var9, var6 + var8}
set{totals, var9 - var7}

add column totals{score} /*total of all points*/
add column idsu{idsu} /*how many days stock closed up on index down*/
add column iusu{iusu} /*how many days stock followed the index up*/
add column idsd{idsd} /*how many days a stock followed the index down*/
add column iusd{iusd} /*how many days a stock went down, opposing an index uptrend*/
sort column 5 descending
]












Kevin_in_GA
4,599 posts
msg #92809
Ignore Kevin_in_GA
5/16/2010 9:31:37 AM

No, you're not crazy. This is a clever way to look at stocks - in essence you are trying to quantify what most investors look at qualitatively.

I like your coding structure and the fact that you are careful and complete in your annotation of what you are doing at each step. That is the sign of a good programmer and a good mentor.

After running this filter against some others I look at, my only comment on its approach is that it is semi-quantitative (it gives a score based on the occurance of an event, but ignores the magnitude of the event). A stock might close one penny up against a small drop in the ^INX, and it gets three points, but if it drops 10% against a 0.01% drop in the same index, it gets one point rather than it raising a big red flag. Unlike other statistical filters here (MTC, 5% A WEEK/CROCK POT, RFR) it is not looking at a minimum performance threshold that one would bet on.

This is a momentum indicator, and when I compare it against other momentum indicators such as relative strength(^INX,45) I think it does not give as solid a signal. I might also add in a minimum volume requirement to weed out stocks with poor liquidity.

Thanks for sharing this.

Kevin

four
5,087 posts
msg #92810
Ignore four
5/16/2010 10:30:08 AM

Thank you (Both of you).

brank20
41 posts
msg #92818
Ignore brank20
modified
5/16/2010 1:57:05 PM

Thanks for the comments. Ill take what you said and improve on it when i have a few minutes to spare. I might have to upgrade to the premium as im beginning to run into the performance error when doing certain things with this filter, like adding the line score > 100 as a filter.

Ill see what i can do to measure magnitude properly.

reels
29 posts
msg #92828
Ignore reels
5/16/2010 8:09:31 PM

hi Brank20,

------
/*Scoring System - If a stock closes down, when a major index is closed up, it scores 0 points for negatively closing against an up day on the index*/
set{var7, iusd * 0}

set{var8, var4 + var5}
set{var9, var6 + var8}
set{totals, var9 - var7} .....
------

iusd*0 is always 0 so, how do var7 counts on totals?

is iusd*1 weight correct?

thanks
Reels

brank20
41 posts
msg #92856
Ignore brank20
5/17/2010 1:36:47 PM

Good catch. I use different scoring sometimes. Replacing the zero with a different number will give you a negative drawback on the score if you want to penalize stocks that close down against an up index. It was intentionally coded that way to give the end user the ability to customize the penalty for performing poorly.

ChizzleMeTimbers
36 posts
msg #92919
Ignore ChizzleMeTimbers
5/20/2010 8:52:03 AM

ur crazy

StockFetcher Forums · Filter Exchange · Call me crazy...<< >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.