- ago
I have a somewhat unusual strategy condition that I'd like to implement in design blocks, if it's possible in WL8:

Only enter into a new position if there are at least 2 entry signals this bar; always choose the second signal (ordered by Transaction Weight)

Is there a way to make something like this work?
0
122
Solved
12 Replies

Reply

Bookmark

Sort
Cone8
 ( 6.71% )
- ago
#1
Which signal is the "second signal"?

Anyhow, if you "only enter into a position if there are at least 2 entry signals", why wouldn't you just make a condition for that and use one signal (the second one)?

We probably need a clear scenario/example here.
0
- ago
#2
Sounds like a Multi-Condition Group could be used with the same signal added twice to it?
0
- ago
#3
Sorry, I may have worded it poorly in the original post. Let me rephrase:

When using a "Transaction Weight", is there a way to avoid entering into a position unless 2 or more symbols meet the strategy conditions? If so, always choose the 2nd symbol (sorted by Transaction Weight)

Below is a simple contrived example. Let's say symbols A, B, and C all meet the criteria. A has the lowest RSI, B has the 2nd lowest RSI, and C has the 3rd lowest RSI. So we'd want some way to skip A and choose symbol B instead.

0
Cone8
 ( 6.71% )
- ago
#4
Similar to "Symbol Ranking by Indicator", it's a pretty specific rule that would need a specific block. You need a "penultimate" option.

And what about symbol C, which had even a lower RSI?
1
- ago
#5
In the example, Symbol C actually had the highest RSI of the 3 symbols, and would therefore be ignored.

I actually hadn't seen/used "Symbol Ranking by Indicator" before, it does seem to be close to the goal. If I understand its functionality correctly, the only difference needed would be to change from "Symbol is Ranked Top 5 by RSI" to "Symbol is Ranked Exactly 2 by RSI".
0
- ago
#6
I'd suggest to do it the other way round:
Build your entry condition in a way that it produces just one signal.
In the case here use the "Portfolio Percentile Rank" indicator PFPR on RSI to find the Symbol you're interested in.
0
- ago
#7
PFPR is now part of finantic.Indicators.
0
- ago
#8
Example:
If your portfolio contains 100 symbols,
PFPR(... RSI(...), ...) == 99
will be true for the symbol with the second highest RSI value within the portfolio.
If there is a different number of active symbols you'll need to adapt that condition.
The expression shown above can be enteted "as is" in an FxCondition Block.
1
- ago
#9
FxCondition is part of finantic.Eval extension.
1
Glitch8
 ( 11.74% )
- ago
#10
Adds amazing flexibility to WL8!
2
- ago
#11
Here is the complete solution for your original request. There are two parts:

#1 Create a condition:
PFPR(RSI) < 100
This will exclude the symbol with highest RSI. The symbol with highest RSI will always have an PFPR of 100.

#2 Use PFPR(RSI) as transaction weight. Limit to one open position.

PFPR uses a cache internally, so it will be calculated just once, even if used in two different building Blocks.
1
Best Answer
- ago
#12
That's incredible, thank you for the solution!
0

Reply

Bookmark

Sort