- ago
Hello,

I am trying to figure out why my strategy has such different results when I deactivate either the short or long side. It is a symmetrical strategy that uses nearly all of the same parameters to go both short and long. However, since the long and short entries are separate, I would imagine they would be managed separately. When I deactivate one side and make the strategy either only long or only short, the results are very different from the "long only" or "short only" results in the backtest metrics.

The reason I want to solve this is because I want to use this strategy as a shorting strategy and not use the long side. I want to be sure that my results for the short side of this strategy are accurate.

I should also note that this backtest is the results of using WFO.

Here is the entire strategy, it looks cut off but it is there in its entirety:


Here is the results when combined:


Here are the results when set to short only:


Here are the results when set to long only:
0
196
13 Replies

Reply

Bookmark

Sort
Glitch8
 ( 7.81% )
- ago
#1
The factors that can cause this are:

1) A position sizing based on equity size, and the changing account equity affecting position sizes.
2) NSF positions that are exacerbated by issuing more trades when another side of the strategy is activated.

In short, it's completely expected that doing this might lead to extremely different results.
1
- ago
#2
So I should have posted the settings page but now I am on the road.

Neither of those should be a factor because the position is a consistent 100k and there are no NSF positions as the strategy is set to be over capitalized.
0
Glitch8
 ( 7.81% )
- ago
#3
I don't know what to tell you, other than you'll have to look more closely at things I guess to figure out why. When I run a Long/Short Strategy, ensure no NSF, and then run it again disabling the Short side, then Long side is exactly the same.

1
- ago
#4
Yeah I really can't figure it out, I have been thinking about it for a couple of days. Do you have any ideas of what to look at?
0
- ago
#5
Instead of making us guess, could you provide as many evidence as possible? Screenshots, Strategy XML, even the very basic things like S. Settings and data provider(s) checked.
0
- ago
#6
Sorry I have been traveling for a few days. Just getting back to this.

I believe the problem has something to do with the various parameters that WL creates when I copy a block using ctrl+shift. When a block has an optimizable parameter, it usually creates a second one with a "2" next to it. When I disabled the long blocks it did something strange to the short blocks that shared the same parameters.

I also sometimes get this error when I make such changes. I believe this error occurs when WL is looking for a parameter but it doesn't find it because it has been disabled or otherwise is inaccessable:

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')
at WealthLab.Core.ParameterList.AssignValues(List`1 values)
at WealthLab.Backtest.Strategy.AssignParameterDefaults(List`1 values)
at WealthLab8.cwStrategy.SaveParameterDefaults(List`1 paramValues)
at WealthLab.WPF.OptimizationVisualizerBase.SaveParameterDefaults(OptimizationResult or, FrameworkElement confirmElement)
at WealthLab8.orvTabularWFO.PostObject(Object setup, RoutedEventArgs token)
at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
at System.Windows.Controls.MenuItem.InvokeClickAfterRender(Object arg)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
0
Glitch8
 ( 7.81% )
- ago
#7
I was able to duplicate the exception copying parameters in this manner. I'll work on resolving it for the next build.
1
- ago
#8
That's great Glitch, thank you.

I was hoping maybe that was the cause of all the differences between long+short and long only/short only, but I just did another test that makes me think there is something else going on as well.

I created a brand new strategy where I didn't copy any blocks and I manually created the parameters. This way there were no new parameters created by the copying process that might throw things off. However, I still ended up with radically different results. The total long positions went from 253 over 23 years to 50. Profitability dropped by more than half.

Again, it doesn't make sense since the long/short conditions do not depend on each other. The only thing I can think of is that I remember Cone or someone mentioning that WL has a hard time when it is both long and short. I don't believe that is happening with this strategy, but because of the WFO parameters changing, perhaps that is occurring. What is surprising to me, however, is that the results are the same every time, which was not my experience in the past when WL had trouble with simultaneous long/short positions.

I will try to provide the other information Glitch asked for above. The only two historical providers checked are IQfeed and IB. IB is not being used because it is not connected and the symbol is an IQfeed symbol.

I have emailed the strategy to support@wealth-lab.com. In order to create the problem all you have to do is run a backtest, then compare the backtest to one after disabling the short side blocks.

Please let me know if there is any other information or evidence I should provide.

Here is a pic of my strategy settings:
0
Cone8
 ( 24.56% )
- ago
#9
QUOTE:
I remember Cone or someone mentioning that WL has a hard time when it is both long and short.
We're missing context, but WL doesn't have a problem with that in a backtest - a position is a position. However, you'd have a hard time trading a strategy that did that with a broker.
0
Glitch8
 ( 7.81% )
- ago
#11
Thanks for sending the strategy, I'm seeing the same thing, it has something to do with the optimization of the ADX level, but something's not right. Going to look into it and figure it out!
0
- ago
#12
I'm sorry Cone. I think I recalled incorrectly. What we had discussed before was when a strategy goes both long and short on the same bar. That is not relevant here.
1
Glitch8
 ( 7.81% )
- ago
#13
I have a definitive update on this. Discovered a flawed interaction between processing WFO parameters and disabling some of the Building Blocks. It's corrected for Build 74, so your Strategy should match Long results when Short Bllocks are disabled after we release the next update.
1

Reply

Bookmark

Sort