Limit Position's Quantity to a percentage of the Bar Volume: Which bar?
Author: murty
Creation Date: 6/7/2013 5:01 PM
profile picture

murty

#1
In my WL6, I have:
Preferences: Backtest Settings: Limit Position's Quantity to a percentage of the Bar Volume: 10
AND
Preferences: Trading: Trading Options: Exit Orders should always exit full position: NOT checked.

I am now concerned that when I buy a stock, I will buy less than size recommended by position sizer but when I exit I might not sell all the position because the bar volume has changed since I acquired the position.

Backtest results so far do not show such discrepancy, however. My strategy generates signal on bar and buys on bar+1. For my above settings:

1. Which bar's volume is used when entering a position?
2. Which bar's volume is used when exiting the same position?

Thanks in advance

profile picture

Eugene

#2
"Exit Orders should always exit full position" does not apply to backtesting: it applies to to paper/live trading.

1. When entering a position, the volume on "bar" is used
2. N/A.
profile picture

murty

#3
So if check "Exit Orders should always exit full position", backtest and trade a strategy then why should the positions be out of sync, when backtest anyway exits all the position and so does live trade because I checked the option "Exit Orders should always exit full position" ? Does the warning still apply in this case?
profile picture

Eugene

#4
If a strategy exits all the position anyway, why worry?

For a collection of possible reasons of getting out of sync please refer to the User Guide > Orders > Portfolio Synch.
profile picture

adrian50697

#5
Is there a way to change the bar that 'Limit a Position's Quantity to a Percentage of the Bar's Volume' uses? In live trading the volume on "bar" is not known until after the fact and so the backtest cannot be replicated in live trading. Alternately is there another way to limit the trade size to yesterday's volume or average of last X days volume etc. ?
profile picture

Eugene

#6
Unlike "Exit Orders", this option ("Limit Position's Quantity...") applies to backtests and does not coincide with live trading. Like I said in the first reply:
QUOTE:
1. When entering a position, the volume on "bar" is used

The volume on "bar" is very well known in live trading because it's the last bar (Bars.Count - 1) available to your system that it just used to generate Alerts for the incomplete bar+1. Of course this option is N/A in live trading as you can not know the partial bar's volume until it closes.

QUOTE:
Alternately is there another way to limit the trade size to yesterday's volume or average of last X days volume etc. ?

Yes there is - the Position Options PosSizer uses SMA of Volume:

* Reduce a position's size to a percentage of the N-day moving average of Volume

Please correct me if I'm wrong because your problem doesn't make sense to me.
profile picture

adrian50697

#7
All good. PosSizer is the solution to what we need. Thanks Eugene.
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).