Filter by Weekly RSI, then filter by Daily Stochastic, with maximum candidates = 15
Author: johnls101
Creation Date: 12/19/2013 1:47 PM

#### johnls101

#1
Hi everyone,

I note that when the rules based system is used, that names are ascribed to sets that are bought e.g. "Group1".

However, I would like to use the priority property not to label anything that I have bought, but to label a preliminary filtered set that I could then work on.

For example, I would like to define my "Group1"filtered set as having a minimum RSI (periodicity 200 in a weekly time frame) threshold of 60. I would also like to define the method of priority as being the highest RSI. This group would then be declared as "Group 1"

I would then like to take Group 1, synchronize it to a daily time frame. From Group 1 I would then want to assign a new priority process. E.g. In a daily time frame I could then take the members of Group1 and apply a minimum Stochastic K threshold of 80 (periodicity 50). I would then like to prioritize these on the basis of the highest Stochastic K.

How can I do this?

#### johnls101

#2
Sorry. I should clarify something from my example above so that it makes sense.

Group1 should have a certain maximum number of members e.g. 15 members, such that if there were 250 opportunities at a particular instance, only the best 15 would be accepted into Group 1 and 235 would be eliminated.

The 15 members of Group 1 would then be worked on, bar by bar, for their Stochastic K priority.

#### Eugene

#3
Hi John,
QUOTE:
I note that when the rules based system is used, that names are ascribed to sets that are bought e.g. "Group1".

FYI, here's what our FAQ has to say: After generating strategy code with "View Strategy Code", there are strings like "Group1" and "Group1|". What do they mean?

QUOTE:
How can I do this?

You can do this by converting the rule-based strategy into code-based and manually programming your idea. Fortunately, it's a rotational system and there are numerous examples out there. Here's how can it look like. Run on All Data on Daily scale in Single Symbol mode starting on symbol with largest history available:

CODE:

#### johnls101

#4
Hi Eugene

Thanks so much for the code and your work on this, but please be patient, I am a new coder and new to forums also.

For some reason the code that you sent does not make any trades for me and I do not know why. I have tried the code on individual members of the ASX 200 and the whole set. It doesn't seem to make any difference. I thought that rotational strategies were often applied to individual members for ranking.

What is the difference between the .priority property and rotational ranking? It seems to me that the priority property does similar things but with a whole lot less mess. Can I use the priority property for my idea above and keep it simple ?
Is there a good link for the use of the priority property? By the way, I am not just interested in doing this for two systems that are long filters, but a very short reversional system attached at the end of it all that would also be prioritised.

#### Eugene

#5
QUOTE:
Can I use the priority property for my idea above and keep it simple ?

You're confusing Priority with the inherent rotational nature of your system. The Priority property comes into play where there are several trade alerts and there's not enough capital to take all of them. This is what my code is already doing for the StochK rule. Wealth-Lab executes strategies in single-symbol Raw Profit mode, then applying the position sizing overlay to arrive at a portfolio simulation. So without resorting to the Rotation trick, it's problematic to leave just 15 candidates in the Group1 and continue working with them bar by bar.

Still, I think it's possible to keep it simple by using this "traditional" code below with the Position Options PosSizer to limit the maximum open positions to 15 (don't forget to press respective button, as typing in a number in the field is not enough):

CODE:

Position Options is the key here.

#### johnls101

#6
Thank you for the priority code.

With the original rotational system with your code I still do not seem to be having any trades happening. I have selected "All Data", "Daily scale" and I have selected a symbol which I know has always been in the index. Still nothing happens.

Suggestions?

#### Eugene

#7
Suggestions:

1) Provide more details as your message contains no clues. You know, it always works here.

* Position sizing?
* How many skipped trades there are?
* Is there enough data?
* Is there maybe a runtime error?
* Did you try on a different DataSet? different data provider?
etc.

2) Give the 2nd code a try.
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).