I am new to wealth builder and have not learned to code and the rule based does not facilitate what I am wanting. Is there someone who can provide some code that will pull the bottom (x) number of stock with the lowest price/sales ratio. This would sure be helpful to me.
Regards,
Stephen
Size:
Color:
Not sure what Wealth Builder is but in Wealth-Lab, this kind of strategies is accomplished through the process known as rotation. Check out the Symbol Rotation folder, open the "RSI Rotation" strategy, and then modify it according to what this FAQ says:
I need other rotation rule other than the built-in RSI.Here's an example but
note: price_to_sales_ratio must be replaced with the actual fundamental item representing this ratio, if it's available in Fidelity's fundamental data:
CODE:
Please log in to see this code.
Check out the Fundamental Data list (hit Ctrl-U) to find it. (I don't work with WLP and don't remember is it available or not. WLD users with the YCharts fundamental provider would need the item called "[yc] ps_ratio" to use price/sales ratio in their strategies).
Size:
Color:
Fidelity fundamental ratios are derived from the fundamental items that are available. Price to sales would be accomplished like this:
CODE:
Please log in to see this code.
You can also use the Strategy Builder to drag and drop fundamental ratios. Their derivation will look a little different because it uses a Rules class. If you prefer that method, more info in the WealthScript Language Guide > WealthLab.Rules Classes > FundamentalsRatio
Size:
Color:
I appreciate your help. I almost got it to work but kept compiling an error saying it should be a double. Tried coding in a double where int exist and kept getting errors. Too much work, so sure makes me apprciate what you all do.
Size:
Color:
If you paste the problematic code snippet here we could try to fix it.
Size:
Color:
Also please indicate which Wealth-Lab version and build you are using.
Size:
Color:
Wealth Lab Pro 6.1; error states" Error CS0536 @ (11,15) 'WealthLab.Strategies.RSIRotation' does not implement interface member 'System.Collections.Generic.IComparer<WealthLab.Strategies.RSIRotation>.Compare<WealthLabStrategiesRSIRotation,Wealth
Size:
Color:
Some other modification was made to the rotation strategy's code. Share the code here so we could check what went wrong.
Size:
Color:
CODE:
Please log in to see this code.
Size:
Color:
Question I have is once this works will this strategy pull all stocks with the bottom x price/sales ratio or the stocks in my selected dataset?
Size:
Color:
There's quite a bit of changes that make no sense like defining the "bar" as
double, turning the code into garbage. Let's start over with the "RSI Rotation" strategy.
Replace this:
CODE:
Please log in to see this code.
with what Cone suggested:
CODE:
Please log in to see this code.
Please keep from adding any other breaking changes e.g.
public double Compare, thank you.
QUOTE:
Question I have is once this works will this strategy pull all stocks with the bottom x price/sales ratio or the stocks in my selected dataset?
Yes.
Size:
Color:
OK, Here is what I get.
error CS0029 @ (68,20): Cannot implicitly convert type 'WealthLab.DataSeries' to 'double'
Here is code
CODE:
Please log in to see this code.
Size:
Color:
I'm sorry, Cone's last code line should read as:
CODE:
Please log in to see this code.
Size:
Color: