Suppose I want to trade a dataset, and keep doubling down when RSI crosses below N, so that I have multiple positions in the same symbol. But I only want that symbol open. Then when those trades are exited (RSI crosses above N), I can begin to enter the next symbol the same way depending on RSI crossing below N. This is to avoid non-corelated trades. How can this be done?
Thanks
Size:
Color:
You have described the built-in RSI Agita strategy. The extra condition "only one symbol open + multiple positions" can be accomplished without programming. The
Position Options PosSizer from
MS123 PosSizer Library provides a convenient way to limit the number of positions to take in a single instrument. Install the library, restart WLP, choose the PosSizer, then set it up like shown below:
For it to do the trick, make sure that "Max open in symbol" is equal to "Max open in symbol". Type in your preferred number in both input fields
and click the buttons on the left of them to activate the options.
Size:
Color:
Eugene, I tried the "only one symbol open" idea with Position Options, but it didn't work for me. It's clear that you you'll only get 3 positions, but if you get 3 triggers for 3 symbols on the same bar, this will still result in trades on 3 different symbols.
To accomplish what the topic starter wants, I think a DataSetSymbols loop and associated logic is required to control putting on multiple positions in only 1 symbol. In the scenario I described, you'd need to choose the first symbol by assigning a priority.
Another "Position Options" option could do it too: "Allow trades for only n Symbols" [n Selector]
Size:
Color:
QUOTE:
Another "Position Options" option could do it too: "Allow trades for only n Symbols" [n Selector]
Let me think it over after I meet a deadline.
Size:
Color:
@cmtn
Look for the new option "Max open symbols" in "Position Options". It should do exactly what you're asking for.
ETA for MS123 PosSizers 2019.07 = end of June.
Size:
Color:
Ok Thanks.
While I wait on the new PosSizers, I've tried the DataSetSymbols approach by, before trying to buy, calling a function that loops for entry and exit dates on closed positions and returns false if another symbol exists between those dates.
I can't get that to work. Can you happen to think of a reason why that wouldn't work, or have any tips you can pass on?
Size:
Color:
I can't get that to work too! Must be your strategy code that doesn't run. How did you manage to post it here invisibly? :-)
Size:
Color:
Here's
something that will demonstrate the idea with DataSetSymbols. Logic is explained in the comments. There's no sorting or priority included. If you were really interested to trade this, I would sort the candidate signals by rsi and assign the highest priority to the trades with the lowest rsi, as is done in RSI Rotation. Of course, once a symbol is active, it will be favored by the logic below.
WARNING!
Click
one symbol only to run (the symbol should have history to encompass the entire test range)
CODE:
Please log in to see this code.
Size:
Color:
@cmtn
Craig, the feature is now available in "Position Options" as of MS123 PosSizers v2019.07. I look forward to your feedback.
Size:
Color:
This seems to be doing exactly what I wanted. Thanks.
Size:
Color:
Glad to hear that!
Size:
Color: