I would like to use the Rotation strategy but with a filter up front. eg Price greater then moving average for those stocks in the rotation before rotation based on RSI
Rename
You could achieve it by running a strategy that would filter the stocks and print them with WriteToDebugLog (for example). To avoid the extra step, here's a rotation strategy template which you can modify to gain more control (see Springroll's Post #20):
https://www.wealth-lab.com/Discussion/Converting-a-WL6-rotation-script-to-WL7-5613
https://www.wealth-lab.com/Discussion/Converting-a-WL6-rotation-script-to-WL7-5613
Thank you for the above link but it would require significant time to convert to WL7. I was wondering whether I could add a filter to the Rotation Strategy provided in WL7
Rotation Strategy does not have a way to prefilter stocks. Since the code above is already for WL7, it shouldn't take long to modify the provided template with a moving average filter like in your title post.
A Blocks like filter would be cool to have but unfortunately, it's impossible as Dion said in Post #4:
https://www.wealth-lab.com/Discussion/Edit-rotational-strategies-with-code-6253
A Blocks like filter would be cool to have but unfortunately, it's impossible as Dion said in Post #4:
https://www.wealth-lab.com/Discussion/Edit-rotational-strategies-with-code-6253
QUOTE:
I would like to use the Rotation strategy but with a filter up front. eg Price greater then moving average for those stocks in the rotation before rotation based on RSI
To avoid the hassle of writing complex code for rotational strategies, I use a workaround, which is very simple. Everything is exactly the same as in conventional strategies, only all positions are closed at the beginning of the month (week) and at the same moment new positions are reopened. In this case, you can easily insert any filters in any quantity.
For example:
@fred9999, thanks for sharing your idea. You might want to note Post #5 though:
https://www.wealth-lab.com/Discussion/Unexpected-Bars-Held-in-Positions-6588
https://www.wealth-lab.com/Discussion/Unexpected-Bars-Held-in-Positions-6588
Your Response
Post
Edit Post
Login is required