Twice as many shares as there should be
Author: rbryant
Creation Date: 2/27/2010 11:05 AM
profile picture

rbryant

#1
Hi

Im trying to compare my actual trades to the trades indicated in WL5 for the last month, and I consistently get approx 2x as many shares showing for each trade in WL5. The account size I choose in WL5 is per my real trading, the period used is short (3 months) so no time for the account in WL5 to double, the leverage is set to 1.0. Im using 0.75% riskstoplevel.

I have checked my spreadsheet calculating my real life trades and it is working as per the WL5 script, with the right riskstoplevel etc. The only thing I can think of is that my account size in WL5 shows in £ sterling for some reason (I trade on IB in the US in dollars but live in the UK). Is there some currency translation rate embedded in WL5 which has £/$ of ~2.0?

Any other ideas?

Thanks. Without fixing this I cant be sure if my backtesting will match reality.
Rod
profile picture

Cone

#2
There is no built-in support for multiple currencies in Wealth-Lab. Whatever currency the issue is priced in is "the currency". If backtests mix issues from different currencies, then you have to account for it yourself in some manner.
profile picture

rbryant

#3
Thanks Cone, but I guess I didnt explain myself properly. I am using 0.75% risk per trade. My riskstoplevel is 1.75xATR(10) below the prior close. In Excel, using the same account size, I am calculating (and entering as real-life trades) about half the number of shares per trade as WL5 is calculating. I have checked all my calculations in Excel many times, both yesterday and over the last few weeks. I am concerned there is a problem in WL5.

I have leverage set to 1 in WL5, and the same account size as I am using in Excel, but the trades are roughly twice as large. Any way you can help me? If I dont resolve this then I cant trust my backtesting in WL5.
profile picture

Eugene

#4
How do you define RiskStopLevel in your strategy? Can you post some code?
profile picture

rbryant

#5
Thanks Eugene. Here is the relevant segment:

CODE:
Please log in to see this code.


Maybe its the max comment. Ill have to check. I put that in so not ridiculous results for very historical share prices that are low because of adjustments for accumulated dividends.
profile picture

Eugene

#6
Looks OK to me on the surface. Next question: is your Symbol Info Manager specifically configured for some symbol, or you're using wildcards, etc.? Also, could you show a trade that had twice the shares it should have: the OHLC data, the ATR value, the size, whatever else?
profile picture

rbryant

#7
Hi Eugene

I think I have it worked out. I was calculating risk and shares to enter off the close, while my order was x*ATR below the close. Could you please clarify whether sizing is based off the limit order price, or the fill price (it has to be the former logically as the fill is unknown when the order is placed).

Your last question made me be more specific re: reconciliation with my actual trades, and brought home how to (continue to) be a successful mechanical trader one must be very very specific in all the mathematics.

Thanks.

PS: I did note a strange thing that the amount of shares shown on the chart in WL5 for a trade in backtesting didnt always match the shares shown in the in the trade list. Have you come across that before?

profile picture

Eugene

#8
Hi Rodney,
QUOTE:
Could you please clarify whether sizing is based off the limit order price, or the fill price (it has to be the former logically as the fill is unknown when the order is placed).

Sizing is based on the basis price (see the User Guide). In the limit order case, the basis price is equal to your limit price.
QUOTE:
PS: I did note a strange thing that the amount of shares shown on the chart in WL5 for a trade in backtesting didnt always match the shares shown in the in the trade list. Have you come across that before?

If you could be specific enough to show us how to reproduce it, I guess we'll find out what's wrong and how to fix it.
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).