longhornxtreme 9 posts msg #47078  Ignore longhornxtreme 
9/20/2006 10:47:36 AM
thanks TRO, set{variable, function} is the syntax. Thanks again.

longhornxtreme 9 posts msg #47079  Ignore longhornxtreme modified 
9/20/2006 11:25:02 AM
Well, After trying to take TRO's filter and modify it I'm screwing up somewhere... here's what I have so far but even when I bump the % up to almost 1 it still hits 0 stocks whereas TRO's hits thousands...
I'm trying to find stocks where all 12 of the EMA's are converged to within X% or less... here's the first one: (that's not working even with screening for EMA's with 91% difference which tells me its borked)

set{meanshort, ((EMA(3)+EMA(5)+EMA(8)+EMA(10)+EMA(12)+EMA(15))/6)}
set{meanlong, ((EMA(30)+EMA(35)+EMA(40)+EMA(45)+EMA(50)+EMA(60))/6)}
set{diff, ABS(meanshort  meanlong)}
set{%GuppyMMA, diff / close}
add column %GuppyMMA
show stocks where %GuppyMMA<.91
_______________________________________________________________________
Would it be better to do something like:
var1 = (Sum of all 12 EMA's)/12)
var2 = var1 / close ####This gives more like a .9x number therefore
var3 = ABS(1  var2) #######we take one and subtract var2 and then ABS to get %
show stocks where var3 is < .01

longhornxtreme 9 posts msg #47080  Ignore longhornxtreme 
9/20/2006 11:40:41 AM
Well I tried my hand at programming the scenario at the bottom of my last post... doesn't work as it gives me stuff like ORCL and QQQQ which aren't at all what I'm looking for...
Gotta figure out the right algorithm...
Not working filter:

set{var1, EMA(3)+EMA(5)+EMA(8)+EMA(10)+EMA(12)+EMA(15)}
set{var2, EMA(30)+EMA(35)+EMA(40)+EMA(45)+EMA(50)+EMA(60)}
set{var3, var1 + var2}
set{var4, var3 / 12}
set{var5, var4 / close}
set{Guppy, ABS(1var5)}
add column Guppy
show stocks where Guppy is <.01


longhornxtreme 9 posts msg #47081  Ignore longhornxtreme 
9/20/2006 12:39:14 PM
@Niko
I can see how you've manipulated the MetaStock filter to SF but not how to actually use it...
I'm such a newb with SF

nikoschopen 2,824 posts msg #47083  Ignore nikoschopen 
9/20/2006 3:58:11 PM
longhornxtreme sez: I can see how you've manipulated the MetaStock filter to SF but not how to actually use it...
I've merely converted the Guppy MMS "formula" from MS into SF algorithm. In order to actually use it, I would think you need to add a condition of ure own (eg. "beam me up, Scotty, only when prices trip and fall below that...that...Guppy ass line" or the like).
_________________________________________
longhornxtreme sez: Would it be better to do something like:
var1 = (Sum of all 12 EMA's)/12)
var2 = var1 / close ####This gives more like a .9x number therefore
var3 = ABS(1  var2) #######we take one and subtract var2 and then ABS to get %
show stocks where var3 is < .01
One of the perennial gripes found here at SF (sez who?) is perhaps with the archaic, not to mention constipated, parser that will evaluate no more than two expressions at a time. When you force more than two expressions down its throat, it'll spit out an error message. For instance, it can't handle
set{var1,(EMA(3) + EMA(5)) / 2}
but it will digest
set{var1, EMA(3) + EMA(5)}
set{var2, var1 / 2}
Now, what a freakfest it would be to repeat the same process for hundreds, if not thousands, of lines of code!
