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?
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?
Rename
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.
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.
Sounds like a Multi-Condition Group could be used with the same signal added twice to it?
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.
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.
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?
And what about symbol C, which had even a lower RSI?
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".
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".
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.
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.
PFPR is now part of finantic.Indicators.
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.
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.
FxCondition is part of finantic.Eval extension.
Adds amazing flexibility to WL8!
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 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.
That's incredible, thank you for the solution!
Your Response
Post
Edit Post
Login is required