Hi,
i don't know if i didn't understand this position sizing, but the result isn't what i've expected.
My expectation is:
If the price comes down 20 Points, i will get stopped out. So when max percent risk is 2%, These 20 points causes a loss of 2% of my whole equity. Isn't it?
If the stop loss is set at 40 points below price, the loss is 2%, too. But in this case the position size is half as the position size with 20 points SL.
If my expectation is correct, the following code set the position size nearly the same for each trade (not 2 times higher or lower as i would expect.).
If my expectation is wrong, i would like to know how to get this requirement.
So here is my senseless example code:
CODE:
Please log in to see this code.
Size:
Color:
Hi,
QUOTE:
the following code set the position size nearly the same for each trade (not 2 times higher or lower as i would expect.).
If the position size is nearly the same for each trade, you might have forgotten to choose "Max Percent Risk" in the Position Size dropdown.
Size:
Color:
Hi Eugene,
that cannot be the Problem (see screenshots). I have also tried to increase the margin (with no effect). You can see the different profits (losses) because of the constant position sizes. I guess i did something wrong but what?.
Size:
Color:
Daniel, your RiskStopLevel is not set appropriately with regard to the instrument's (high) price. Try your example without change on an adequately priced stock e.g. AAPL or say ADS.DE. Or for ^GDAXI, increase the stop distance by an order of magnitude e.g. Open[bar] - 200 / Open[bar] - 400.
Size:
Color:
Oh thanks for your help, now i have understand.
Size:
Color:
Sorry, i have still a question:
I want to set the RiskStopLevel to the low of the last bar (Max Percent Risk is set to 1.0, Starting Capital 10k)
CODE:
Please log in to see this code.
As you can see in the screenshot, the quantity is 127 for a 2 € difference between entry price and riskstoplevel. I would expect that for a risk of 1% the quantity is 50 Shares ... so it results in a loss that is much too high.
The requirement that is easy to handle in real life:
1. MaxRisk: 1% -> i don't wanna lost more than 100 € for this trade
2. MarketOpenPrice: 50.0, low of yesterday: 48 €
3. Set share size to: 50 (50x2 = 100)
Regards Daniel
Size:
Color:
Wealth-Lab has to determine the position size
before issuing an Alert for bar+1. How does it do it? By using the so called basis price. Check out the User Guide > Strategy Window > Backtesting Strategies > 100% of Equity Sizing >
Basis Price. If you were using a stop or limit order and there weren't a gap, that would present an easier scenario with the price known beforehand. But since you're using an AtMarket order, Wealth-Lab calculates the position size based on the previous bar's Close price which wasn't 67.64 but 66.41 @ 09/08/2015.
Let's break down your screenshot step by step for easier understanding:
Current Equity: $10,000
Position Basis Price: $66.41
Initial Stop Level: $65.64
Max Percent Risk: 1%
Position Size Shares: ( 0.01 * $10,000 ) / ( $66.41 - $65.64 ) = 130 shares. Since your equity wasn't precisely $10,000 on that bar you got only 127 shares.
Loss at stop price: 130 * ( $66.41 - $65.64 ) = $130 * 0.77 = $100 or 1% Equity. Voila.
Size:
Color:
Hi Eugene,
so what is your recommendation for using the corrcect max losses (and their positions) ? BuyAtClose? -> i've tried that and got mostly too less shares ... (less than half i've expected)
Calculating the position sizes on bar "X" and entering the trade on the next bar with higher price always causes much more losses ... (see my requirements above)
In real life i would calculate the Position size on the day when i do the trade. Perhaps it isn't possible to backtest that strategy?
To summarize my requirement: i want to calculate the position size for max risk in the moment when i buy the shares ... otherwise i often get too much or too less shares
Regards Daniel
Size:
Color:
Daniel, here Wealth-Lab works by design. In real life, when determining the position size "today's" evening to be executed at "tomorrow's" open you don't have the luxury to peek at tomorrow's open price. You can not do it in real life. Fortunately, for *AtMarket orders at bar+1 (only) it's possible to adjust the basis price from Close[bar] to Open[bar+1] using so called "Skipped trade solution" option of the
Position Options PosSizer. It should work for both backtesting and alerts. Since you've got "Constant Risk" PosSizer on your PC as per a previous screenshot, this should already be installed.
Size:
Color:
Thanks, Eugene. That helps me a lot.
Regards Daniel
Size:
Color: