I’d like to implement a dividend yield model based on the work of Geraldine Weiss. Unfortunately I’m having difficulty implementing the main crux of her thesis: buy when the yield is at least 10% off the long-term maximum yield. How could I screen for such stocks? I assume I need LoopMax(), but not sure the best way to get a yield at a particular point in time.
Malcom , I was going to suggest using FHist with LoopMax and the Yield factor, but I realized that FHist wants a constant as the offset. So I took a look at the code and there’s no real reason for that restriction. We will release a fix today so that FHist is allowed to have a variable parameter.
Tomorrow do the following (if you do this now you will get an error that FHist wants a constant parameter)
Click on COMPONENTS->Formula and create the following custom formula
$yieldhist
FHist("yield",CTR)
Then use these two rules in the screener. It will show you the maximum yield of Microsoft for the 52 weeks
returns “[font=courier new]ERROR: Invalid criteria in Rule 2. Invalid parameters for LoopAvg[/font]”.
The example above is rather trivial, yet the ability to define the number of max iterations would be helpful more complicated example (e.g., weighted regression, etc.). Anyone else think it might be useful to pass variables as parameters to the loop functions?
It’s live now. MSFT highest yield for the past 10 Y was actually 3.4%. It’s currently around the lowest 10Y yield of around 1.7%. But IBM is currently around the highest 5% yield.
Note: Some may we wonder why we have to use a custom formula. It’s because our syntax parser does not support nested quotes. Hopefully one day soon will fix this or introduce a way to create custom formulas on the fly.