I'm very interested in the stock rotation approach and applied this new script to the Dow 30 as suggested.
I have set the number of positions n = 4 and set a 25% Equity sizing. The results give me multiple positions in the same stock at the same time. Aren't the n = 4 positions all supposed to be in different stocks?
Am I doing something wrong?
Size:
Color:
Please look for the answer in the Wealth-Lab Wiki FAQ >
Strategies in general and WealthScript-related questions > "A Rotation strategy isn't working like it should."
P.S. Every published Strategy has its own discussion forum, so it's always a good idea to use them to ask questions regarding a specific strategy - like "Weak stock rotation".
When you have a question regarding a published Strategy that you saw and/or downloaded, open
"Public strategies", note the "Discussions" column and the link saying something like
"0 Topics", and use it to discuss the Strategy.
Size:
Color:
I tried to change the stock rotation criterion from ROC to basically a one-bar slope of the SMA.
Now the code produces no rotation at all. Here is the part of the code I changed:
CODE:
Please log in to see this code.
I changed the first and last lines. See any mistakes?
PS, I tried to post this under Discussions of Public Strategies but was unsuccessful.
Size:
Color:
QUOTE:
I changed the first and last lines. See any mistakes?
The whole point was lost with the SMADiff series defined at the beginning vs the commented line. Should be:
CODE:
Please log in to see this code.
Furthermore, it's answered in the Wealth-Lab 5 Wiki FAQ:
I need other rotation rule other than the built-in RSI.Also, look up
SetContext/RestoreContext in the QuickRef to understand why was it important to place it there.
QUOTE:
PS, I tried to post this under Discussions of Public Strategies but was unsuccessful.
I see, thanks for the heads-up.
Size:
Color:
OK, I did read the reference. I now see it means change "only this line." What you gave me almost works, but not quite. It should read
CODE:
Please log in to see this code.
Thanks for your help. Weak-stock rotation is a great code.
Size:
Color:
QUOTE:
It should read
Ah, a copy/paste error it was. Thanks, fixed.
Size:
Color: