PosSizer & Skipped Trades Solution
Author: innertrader
Creation Date: 2/25/2014 9:41 PM
profile picture

innertrader

#1
1. Does the "Skipped Trades Solution" (SKS) referred to in the documentation still exist in V. 6.6? If so, how do I enable and can you point me to documentation on this feature?

2. Is there any documentation for what the numerous PosSizer options do? I have been unable to find any.

I am trying to resolve skipped trades due to insufficient capital. I want to backtest a single symbol vs. B&H. I want to go all in with all available equity when I get a trade signal, which is why Raw mode won't work even though I am only backtesting a single symbol.

Simply adding margin to a level to resolve skipped trades favorably distorts the results for B&H. I thought the SKS was developed as a fix for this. In addition to answering the questions above, please let me know any other options to do what I am trying to do.
profile picture

Eugene

#2
1. It's not a part of 6.6 but an extension:

MS123 PosSizer Library
Position Options PosSizer

2. If you're talking about MS123 PosSizers, then you certainly haven't tried to click the bluish "More info..." button that is present in every one of them and which takes you to one of these pages:

Pages of the Category PosSizers

The few built-in PosSizers do not come with any documentation, though. They're simple and self-descriptive.
profile picture

innertrader

#3
QUOTE:
1. It's not a part of 6.6 but an extension:

MS123 PosSizer Library
Position Options PosSizer

I have downloaded and installed this extension. I have enabled button "Skipped trade solution" in PosSizer>Position Options> Configure but I am still dropping a lot of trades unless I add margin. Why is that?
profile picture

Eugene

#4
This is expected when using 100% sizing. Even with this option (and its brother "For last position, use all what's left") activated, usually one has to reduce the size by a couple of percent points.
profile picture

innertrader

#5
QUOTE:
This is expected when using 100% sizing. Even with this option (and its brother "For last position, use all what's left") activated, usually one has to reduce the size by a couple of percent points.

Even with enabling "Skipped trades..." and "For last position..." I had to bring my Position Size down to 40% of equity to eliminate trade skipping. Currently my program logic closes a position and opens another one with the same signal E.g.:

CODE:
Please log in to see this code.


I experimented by delaying opening a new position by an extra day:

CODE:
Please log in to see this code.


Then I can get the Position Size to 90% of equity with no missed trades and without margin (Margin = 1:1).

Waiting an extra day to open a position is not what I want to do, but it appears that the proceeds of a sale are not available immediately upon execution of a trade signal, at least the way I have implemented it. Is there a way I should re-write the code so that cash proceeds will be immediately available?

It seems like we could benefit from a "Buy as many shares of X as you can with the cash (and margin) you have available" option. That's what I would do if trading manually. Wouldn't that eliminate trade skipping? Is there any way to simulate that with current functionality?

profile picture

Eugene

#6
QUOTE:
but it appears that the proceeds of a sale are not available immediately upon execution of a trade signal, at least the way I have implemented it.

There's hardly something to be done here because to adjust the size, the PosSizer uses the equity/cash levels + margin that are reported by Wealth-Lab for a given bar.
QUOTE:
Is there a way I should re-write the code so that cash proceeds will be immediately available?

CoverAtClose(bar)?
profile picture

innertrader

#7
QUOTE:
This is expected when using 100% sizing. Even with this option (and its brother "For last position, use all what's left") activated, usually one has to reduce the size by a couple of percent points.


It doesn't look like I can select *both* the PosSizer option and the % Equity option at the same time, so can you please clarify your remark above?
profile picture

Eugene

#8
"For last position..." is selectable only when "Max open positions" is active, if you mean that.
profile picture

innertrader

#9
QUOTE:
"For last position..." is selectable only when "Max open positions" is active, if you mean that.

No, I meant that for the Portfolio Simulation Mode sizing selections I can select Percent of Equity or PosSizer radio buttons but not both. They are mutually exclusive. I just now realized that the PosSizer has Pct of Equity embedded as an available option and that's how I get all!
profile picture

innertrader

#10
Back to PosSizer....

I am trying to troubleshoot or understand why none of the solutions (Skipped Trades Solution or Max Positions) seems to be working to avoid having to use margin or significantly lower % equity to avoid skipping trades in my backtests.

I am doing a quasi-rotation strategy that swaps the symbol (based on desired leverage) which is a derivative ETF of the charted symbol. For example, for primary symbol ^NDX, symbols could be QLD, QQQ, or TQQQ. Of course each of these symbols usually have very different prices.

When I engage the PosSizer "Skipped Trades Solution," it is supposed to "peek" at the next bar opening price to size trade so it will execute. In my case, I am selling one symbol and buying a different on the same day (using SetContext). I'm wondering how STS handles that? Does it only peek at the next bar for the symbol I'm buying, or the one I'm selling?

Or is it neither of these? Is it peeking at the Bars.Symbol symbol, which is this case would be ^NDX? I guess I'm asking whether STS knows that context of the symbol has been changed, and if so, which one does it peek at?.
profile picture

Eugene

#11
QUOTE:
Does it only peek at the next bar for the symbol I'm buying, or the one I'm selling?

Only for the symbol being purchased or shorted. By design, PosSizers only size new entries - not exits. Exits are processed by WLP (not the PosSizer) as is, without any requirement to peek at the price.

QUOTE:
significantly lower % equity to avoid skipping trades in my backtests.

For what it's worth, the STS is a workaround but not a silver bullet. Sometimes only a considerable reduction of % equity works. Given WL's architecture, it doesn't seem like there's much room for improvement.
profile picture

innertrader

#12
OK, thanks Eugene. Saved me a lot of time chasing windmills.

I do have another question about Max open positions. I wanted to be sure I understood the use instructions.

1. If I check "For last position..." and I have a max of 2 (different and total) positions, should the number I enter be "1" or "2". My read (based on N+1) is that I want to set it to "1" to take all cash available on second trade. Is that correct?
2. Also, does Max open positions work in conjunction with Skipped trade solution? Can they / should they both be enabled for optimum results?

Robert
profile picture

Eugene

#13
1. I believe the max should be 2 in this case rather than 1.

2. It's likely that they can work together. (If some options were incompatible I guess I'd document it or better, would've disabled the conflicting one of the pair straight in the PosSizer's GUI at design time.) I leave it up to you to decide whether the results are optimal.
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).