Alert vs backtested position size in combination strategy
Author: Christos
Creation Date: 12/1/2011 7:39 AM
profile picture

Christos

#1
I am using the combination strategy builder and I face the following problem.

The alert was showing an order to buyatlimit X number of shares but the next day the position had a different number of shares < X. The individual strategy was not facing the same problem so it must be something relevant to the combination strategy builder functionality. The incorrect number of shares based on the position sizer was the one in the alerts tab.

Any ideas of what I might be doing wrong?
profile picture

Cone

#2
Combination Strategies run only in Portfolio Simulation mode, so the trade results, equity curve, and sizing based on equity, can change from simulation to simulation due to how trades are selected when insufficient cash exists for all the trade candidates.

For non-programmers, the way to avoid that is to go to Preferences (F12) > Backtest Settings > Use Worst Trades in Portfolio Simulation. In other words, in the insufficient cash scenario, the worst-performing trades will always be chosen (given the highest priority), which will always be the same as long as your simulation starts in the same place.

Note that if you're using Last n Years or Fixed bars, the starting date is changing from day to day. You can avoid that by using the Date Range option and fix the starting date.
profile picture

Christos

#3
I believe that this is not the case since there is enough capital available.

In my opinion the problem exists in the alerts Qty calculation and I will explain why.

I use 3 strategies in the simulation strategy and an initial capital of $500,000. The allocation to each strategy is 50% of starting equity and the position sizing of one of the strategies is 2.5%. I am using a start date to backtest the strategy which has not created any trades before so I have all my capital available.

If you do the simple math of $500,000 * 50% * 2.5% / (Symbol Limit Price) you get the number of shares. The problem is that this is not the case in the alerts tab. When the alert has already become a position then the number of shares is correct ( equal to $500,000 * 50% * 2.5% / (Symbol Limit Price) ).

I conlclude that it's not a position priority issue but something else, relative to the combination strategy functionality since this is not happening in the single strategy backtest.
profile picture

Eugene

#4
It's a Position Priority feature. 3 strategies * 50% allocation = exceeds your starting capital and creates a great competition for the equity pool.
profile picture

Christos

#5
I understand that creates competition but I think it is irrelevant to the issue cause the position sizing error is in the alerts tab. The alerts quantity is wrong, not the actual trade!
profile picture

Christos

#6
I have tried several ideas to spot what the problem might be but I am afraid it is beyond my powers. The last attempt was to use only one strategy in the Combination strategy, and allocate 100% of stratign equity to it. Margin factor is 1:1, position sizing is exactly the same as in the standalone strategy. The problem is still there. There is no case of insufficent cash the limit order generated is only one and the capital is only cash - no positions at all. There is also nothing wrong with the child strategy since it behaves as expected when it runs outside the combination strategy environment.
profile picture

Cone

#7
Sounds like we need to duplicate what you're seeing. Maybe we could simulate it by knowing the symbol, limit price, Alert shares and final positions shares?
profile picture

Christos

#8


The Symbol is WAG (it creates similar problems with other symbols) the limit price is 32.83 the alert shares are 307 and the final position shares are 192. As I said in previous post the position sizing is 2.5% and the initial capital is $250,000. The alert is generated as of 29th of November 2011 and the pposition as of the 30th of the same month. Let me know on any other parameters or extra information that you would think that would be helpful for you.

Thanks
profile picture

Cone

#9
WAG's low on 11/30/2011 was 32.87, so the trade could not execute using a limit order at 32.83. Consequently, the only thing I can think of is that the Strategy that bought WAG is not the one you're evaluating with this exercise.
profile picture

Christos

#10
The order was ShortAtLimit and not BuyAtLimit. Apparently the order executed at market open levels.
Sorry for my initial erroneous description.
profile picture

Cone

#11
I see the problem with Alert sizing in the Combination Strategy Window. It's out of whack and appears that it can't be trusted for anything but fixed sizes. Thanks for reporting. At your convenience, I'd appreciate it if you could create a Support Ticket for this bug.
profile picture

Christos

#12
I will definitely create the support ticket within the day.

I also agree with your note about the fixed sizes. This is the only case that the alert size works.
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).