Only one symbol at a time but multiple positions
Author: cmtn
Creation Date: 6/10/2019 9:16 PM
profile picture

cmtn

#1
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
profile picture

Eugene

#2
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.
profile picture

Cone

#3
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]
profile picture

Eugene

#4
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.
profile picture

Eugene

#5
@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.
profile picture

cmtn

#6
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?
profile picture

Eugene

#7
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? :-)
profile picture

Cone

#8
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.
profile picture

Eugene

#9
@cmtn

Craig, the feature is now available in "Position Options" as of MS123 PosSizers v2019.07. I look forward to your feedback.
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).