Ranking symbols and then get top 20 of signals
Author: mestre
Creation Date: 11/9/2014 4:54 AM
profile picture

mestre

#1
I was trying to apply a set of rules to get a ranking on the symbols and then apply another set of rules to the top 20 to get the signals.

Any ideas?

Is it possible?
profile picture

Eugene

#2
Not in a rule-based strategy. Rules have their limitations, so this is too complex but it's possible if you code it. What you're looking for is called "rotation strategy". Start by exploring preinstalled and downloadable code-based strategies from the "Symbol Rotation" folder. As you gain experience, there are dozens of posts on ranking and rotation to be found in our "search as you type". In particular, applying another set of rules was explored in:

Combined rotation/ranking question

Could you be more detailed on your algorithm/rules?
profile picture

mestre

#3
I have this coded in right edge platform, but i can't seem to do it here.

An example:

I want every stock that it's trading above the 100 day SMA with a RSI14 above 50.

This would result in 100 stocks.

I only have 10 slots to fill, so i want to sort the results by some value of the %B. The lower the better.

The 10 best would result in Buy at market [bar +1].

...

profile picture

Eugene

#4
I was confused by the usage of the word "ranking". This is neither "ranking" nor "rotation" in our understanding. You just want to limit the signals/positions to 10 and prioritize them by the % value. This doesn't require coding (almost). To get there, there are two extra steps required:

A. By editing your rule-based strategy, override Wealth-Lab's random double value assigned to position's priority with your custom priority value (i.e. the %B).
B. Use Position Options PosSizer to control the number of positions/alerts.

Here's how:

1. Add your two conditions (Price above > SMA100, RSI14 > 50)
2. Click "Open code in new Strategy window"
3. Now the tricky part. You need to assign each stock its %B value. Where you see the usual...

CODE:
Please log in to see this code.


...you change it like this:

CODE:
Please log in to see this code.


This assumes there's a variable for the %B (BollingerPctB ?) If you need assistance with this, copy/paste your resulting code.

4. Finally, in the PosSizer you need to click "Max open positions" and type in a number (here: 10) in the input field on the right of it.

Voila.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).