"fhist" & "rating"

All,

I’m trying to use “fhist” with the “rating” command, i.e.

fhist(rating("core: value"),4)>80

But receiving errors. Can the two commands be combined, or is my syntax off?

Thx,
Ryan

You can’t nest commands like that.

The workaround is to either use variables with the command SetVar or to use named formulas (click “Research” > “Formulas” > “Add New”)

The Rating command can only be used currently. The best workaround is to use RankPrev(4) and put Core:Value as your ranking system.

And you CAN nest formulas using " and `. But Rating can’t be used in the past.

Thanks all. Agreed w/ Yuval, the nesting using " and ` does work, but the issue here is that rating can’t be used in the past.

On a related note, I’m also using the #groupvar command to find a median value for the set of stocks say greater than rank>95. Usually when using fmedian, the output is a single value for the rules specified. When using fmedian w/ #groupvar, the output results in 2 values:

  • for stocks with rank>95, fmedian output is the median value of stocks passing rank 95
  • for stocks w/ rank<95, fmedian is the median value of stocks rank <95.

I was hoping for the fmedian value to only provide 1 value (for the group specified, rank>95), so this variable can be used in other rules.

Any help?

Thx,
Ryan

#GroupVar divides stocks into two groups and returns the values for each.

If you want only the value for one group to be used, then an Eval function would be better than using GroupVar. For example, you could use FMedian(“Eval (Rank > 95, @function, NA)”).

Perfect, that’s what I’m after. Worked :-). Thanks Yuval.