- ago

Hi ,
Yes it's me again with another problem with the advanced position sizer :)

I am writing to report a potential bug in the multi-currency handling specifically related to the advanced position sizer. I have encountered an inconsistency in the way currency conversion is applied, which affects the calculation of position sizes. Below is a detailed description of the issue:

Scenario 1 (Single Currency - USD):
Account Balance: 100,000 CAD (assumed as USD in WL8 without multi-currency option chekced)
Strategy Execution: Shorting CDNA US Stock at $10.01 using 2% equity risk
Calculation: 2% of $100,000 / $10.01 = 199 shares

Scenario 2 (Multi-Currency - CAD to USD Conversion):
Account Balance: 100,000 CAD
Currency Conversion (CAD to USD): Account value considered as 72,896.92 USD
Strategy Execution: Same strategy with 2% equity risk
Expected Calculation: 2% of 72,896.92 USD / $10.01 = 145 shares
Result: WL8 provides the correct number of shares (145 shares)

Issue with Advanced Position Sizer:
Same tests as above using advanced position sizer with 2% equity risk and 0.5% Max risk
Result without Multi-Currency: 199 shares (as expected)
Result with Multi-Currency (CAD): Only 106 shares

This seems to indicate that the CAD to USD conversion is applied twice. The calculation appears to be based on an account value of 53,139.61 USD (which would be the result of converting 72,896.92 CAD to USD again).
The discrepancy in share count (106 shares instead of the expected 145) suggests an error in the currency conversion process within the advanced position sizer when the multi-currency option is activated.

I have detailed screenshots available to further illustrate this issue if needed.

Thx for the support
Spacious
0
573
17 Replies

Reply

Bookmark

Sort
Cone8
 ( 6.17% )
- ago
#1
Okay, thanks. We've logged it and will investigate and fix.
1
Cone8
 ( 6.17% )
- ago
#2
Yesterday, after reading your post, I modified the title to "Advanced PosSizers apply multi-currency conversion twice"

Previously you had something about Max Risk in the title, but it sounded to me like even if you used the Percent of Equity sizer in an Advanced Sizer, the currency adjustment would be applied twice.

I'm not able to duplicate that. Please tell me precisely the Advanced Sizer you're using and how it's configured.
0
- ago
#3
Hi Cone

Im currently at work so I cant connect to wl8 for now.

I was in the strategy monitor using the advanced position sizer with 2% equity risk and 0.5% Max risk when I got the problem.
But when I simply used the %equity sizer I didnt get the problem.

I will send more detail this afternon.
Thx
1
Cone8
 ( 6.17% )
- ago
#4
Since you were using the Strategy Monitor, it would be helpful to know if you have this trading preference selected -



If the answer is yes, would I be correct in deducing that the associated account value is around 73K?

0
- ago
#5
Okay

Here is the complete information with the screenshot

First position sizer that give me the correct position

Number of shares with 100 000k in USD risking 2% of the equity

The same execution in CAD currency

The number of shares is good. Here is a dummy test converting 609US to CAD which give the right number of shares :


Now the same test using the following advanced pos sizer

The currency in WL8 is set to USD, and I get the right among of share :

Now the same test using CAD currency give me the wrong number of share

I made the same dummy test by converting 609US to 444CAD. And again 444US to 323CAD


You can see that the conversion has been applied twice.

And I also got a problem with ProfitPctAsOf. It was telling me that I made 37% of profit on my position . But maybe it is the same issue. I could document this more in detail after the fix if the problem still occur.

Hope you have enough information to reproduce.
Let me know

Spacious
0
Cone8
 ( 6.17% )
- ago
#6
But these are 2 different sizing methods. The Advanced Sizer you selected is limited to 2% of equity, but you have to calculate the shares for 0.5% Max Risk first. To do that, we need to know the stop value you're using on the signal bar for this trade.

For now I'll assume the shares for the 0.5% Max Risk sizing exceed 2% of the current equity.
0
- ago
#7
You are right and you can assume the shares for the 0.5% Max Risk sizing exceed 2% of the current equity. Otherwise I wouldn't have 610 shares in my attemp using the advanced position sizer with US currency.

I also made the calcualtion using my stop level and it was exceeding the 2% of the current equity.
0
Cone8
 ( 6.17% )
- ago
#8
I still cannot reproduce it. I get precisely the same correct results for both sizers with and without Multi-Currency enabled.
There must be another variable.
0
- ago
#9
The other variable that I think of is the "use Broker Account value for Equity-based PosSizers"
Keep in mind that my broker account value is in Canadian dollar.

I uncheked this option and ran the strategy monitor on the last days to make sure my backtesting capital was still close to the 100k and I got correct number of share.

This look like the missing variable ... Can you retest with this option in mind ?



thx
0
Cone8
 ( 6.17% )
- ago
#10
I suspected this was what you're seeing, but deleted my Post #4 because you said that it worked for one sizer and not the other. If it were only the Broker Account value, it would work the same for both sizers. (Post #4 is now viewable again.)

The Broker Account value, when enabled, is used for the Signals for the Streaming Strategy windows, Strategy Monitor, and Strategy design window.
------
And now I get it.
In summary, the broker account is in CAD, but the system is treating it as a nominal value in USD, right? Which broker is it?
0
- ago
#11
QUOTE:
In summary, the broker account is in CAD, but the system is treating it as a nominal value in USD, right? Which broker is it?

I'm using InteractiveBroker.

I'm not exactly sure what is the problem here. The conversion CAD to USD is applied 2 time when calculating the position size using the advanced position sizer as described above but when using only the % equity the conversion is applied only once.

It appears to be related to the 'Use Broker Account Value for equity-based position sizers' option. When I uncheck this option, everything seems to function correctly.
0
Cone8
 ( 6.17% )
- ago
#12
The "problem" is that we're getting the IB BASE currency and assume it's in USD.
If you change your BASE to USD at IB so that IB reports the BASE in USD, then it will be correct even with Multi-Currency enabled.

However, it would be 10x easier to simply disable Multi-Currency for trading. Then you size positions with the broker-reported value, already in CAD. Is there another reason you need M-C enabled for trading?
0
- ago
#13
But why is it all working correctly when using the % equity sizing ?
I'm pretty sure the advanced position sizer is doing someting wrong.

QUOTE:
However, it would be 10x easier to simply disable Multi-Currency for trading. Then you size positions with the broker-reported value, already in CAD. Is there another reason you need M-C enabled for trading?

If I disable M-C for trading, WL ask IB my current account value which returned 100k. WL think it is 100k US instead of 73k US. This result in having position size to big in my base value (CAD). I don't want to adjust manually all my position size.

I could adjust my IB base value to US but I'm not sure if it will work since i'm funding my account with canadian dollar and I don't want to pay fee to convert CAD to US everytime I deposit or withdraw.

It still doesn't make sense that %equity work properly with M-C but advanced pos sizer doesn't work.
0
- ago
#14
FYI I went to InteractiveBroker and asked the question about base currency.
I'm note 100% sure yet but I think it would be preferable for me to convert CAD to US in my broker account to avoid the loan create by IBKR.

So in the end I might trade in US currency.
That being said, if you can't find the exact problem with M-C and the pos sizer, I think you can stop wasting time on this. I will poke you back if I can't make it work properly with IBKR.

QUOTE:
It is important to note that changing your Base Currency does not convert existing cash balances or change the denomination of a security into any other currency.

The particular currency used to purchase and settle any given instrument, or meet the cash variation on a futures product, is determined by the listing exchange, rather than the broker. Accordingly, if you enter into a transaction to purchase a security which is denominated in a currency that you do not hold and, assuming that you have sufficient margin excess, IBKR will create a loan for those funds. Note that this is necessary as we are obligated to settle that trade with the counterparty (i.e., clearinghouse) solely in the designated currency of denomination.

If you do not wish to have such a loan created and incur its associated interest costs, you would need to either first deposit funds into your account in the required denomination and amount or convert existing funds in your account using either our FXCONV (for amounts under USD 25,000 or equivalent) or IdealPro (for amounts in excess of USD 25,000 or equivalent) venues, both available through the TWS. If performing a conversion and you maintain a Cash type account, that conversion trade will need to settle before the funds are available to apply to any subsequent transaction.
0
Cone8
 ( 6.17% )
- ago
#15
I dug into this more and was able to duplicate it and found the source. Thanks for bringing attention to the issue.

---
fixed for Build 62.
1
- ago
#16
Yeah gj Cone.
Nice to know that I wasnt crazy
1
Cone8
 ( 6.17% )
- ago
#17
In summary, I added this to the Multi-Currency Help, which will be valid starting with Build 62.

Trading a Broker Account with Multi-Currency
For proper equity-based signal sizing, the Account Value reported by the broker must match the specify Multi-Currency base currency. For example, Interactive Brokers reports account value in the customer-specified BASE currency. If the account BASE is EUR and you're trading a USD-denominated market, enable Multi-Currency with EUR to properly size USD positions for your EUR account.
0

Reply

Bookmark

Sort