- ago
Hello WL Team,

I can't program and I work with building blocks.

I would like to test whether it makes sense to pause a system for X days if there have been a number of consecutive negative exits of a certain size.

Example:
5 consecutive exits with more than -10%: Pause the system for 5 days.

The number of negative exits, the amount of losses, and the number of days for the pause should be selectable.

Is it possible to create such a building block?

Best regards
0
163
Solved
6 Replies

Reply

Bookmark

Sort
Cone8
 ( 3.17% )
- ago
#1
I can probably work on a block for that and add it to the PowerPack.

For now, this one is similar, but instead of the consecutive constraint, it checks for N wins/losses within the period. The Logical Inverter prevents new signals when the condition is detected.



The thing is, these blocks generally work on a "per Symbol" basis. You're probably thinking on more of a "Portfolio Backtest" level, right?

And if that's the case, what does "consecutive" mean?
For example, a Daily strategy might have 2 winners and 6 losers. Are there 5 consecutive losers? A reliable consecutive count can only occur on a "per interval" basis, i.e., all must be losers going back historically until a winner is found.
0
- ago
#2
...thanks for the quick reply. The BB is interesting, I'll experiment with it a bit.

Yes, I mean a portfolio backtest.

Consecutive losers:
...yes, that's difficult to determine.

Perhaps, instead of the number of winners or losers, one could insert the percentage or ratio of losers relative to the winners in the BB mentioned. For example, with a daily strategy:

Day 1: 2 winners, 6 losers. Ratio 6 / 2 = 3
Day 2: 1 winner, 2 losers. Ratio 2 / 1 = 2
Day 3: 3 winners, 5 losers. Ratio: 5 / 3 = 1.67

Possible system pause:
If there are X days with a loser ratio above 1, pause for X days.
0
- ago
#3
QUOTE:
Possible system pause:
If there are X days with a loser ratio above 1, pause for X days.

It's a quite interesting approach. Note that you could accomplish a similar objective with the Trade Outcome PosSizer which lets you adjust the trade size on loss or win.
0
Cone8
 ( 3.17% )
- ago
#4
Here's the condition block I've come up with for the next PowerPack build.

This works on a Portfolio level and counts the number of days in the Trading Days Window that the loss/win ratio is >= the Loss Ratio Threshold. If that number is greater than the specified "Days >= Threshold", the condition will remain true for the number of "Cool Off Days".
Leave "Reverse" checked so that true becomes false to prevent trading during the cool-off period.



The Loss Amount lets you ignore very small losses so they don't increase the ratio.

It's not finalized, so let me know if this does the trick or if you have another idea for it. One thing I'm mulling over is to include another variable to ignore days with fewer than N closing trades. For example, 1 loser and 0 wins would count as a day above the threshold and maybe it shouldn't?
0
Best Answer
- ago
#5
Great, thank you very much! I'll test it as soon as it's available. The extended idea of ​​ignoring very small losses is also very useful.
0
Cone8
 ( 3.17% )
- ago
#6
After testing it, there's an unexpected side effect that I think is not desirable. Examples..

Example 1 -
4-day window, and Threshold days = 1 and Cool Off Days = 1. Even though only 1 day hits the threshold, it will remain in the window for 4 trading days, resulting in 4 days of no new entries. Maybe no one would configure it this way (for threshold days = 1, it only makes sense to use a 1-day window) but if they did, the result is not good or expected.

Example 2 -
4-day window, and Threshold days = 2 and Cool Off Days = 1. The separation of days exceeding the threshold complicates this scenario. If day 1 and 4 hit the threshold (1 - 0 - 0 - 1), then only 1 day of no trades will result. But similar to Example 1, if 2 consecutive days hit the threshold (1 - 1 - 0 - 0), they'll be window for 3 trading days, resulting in 3 days or no new trades. Another scenario results if the threshold hits 1 - 0 - 1 - 0.

Suffice to say, the combination of all these options can lead to an unexpected outcomes, so it needed to be simplified as follows:

Remove the Window and use only consecutive Threshold days. "Consecutive" for this purpose means consecutive days for which closing trades existed. Days without closing trades are ignored. Consequently, if Day 1 were above the threshold, Day 2 had no closing trades, and Day 3 were above the threshold, that's 2 consecutive days.

Final options -

0

Reply

Bookmark

Sort