braverock / quantstrat

289 stars 114 forks source link

Conversion betwwen currency #132

Closed VitoFanelli closed 3 years ago

VitoFanelli commented 3 years ago

Hi, I have a question about currency conversion. I have a portfolio and account in EURO (currency). I want to apply a strategy on exchange_rate GBPUSD. I create GBPUSD as exchange_rate and USDEUR as exchange_rate for conversion.

My portfolio/account results will be convert from USD to EUR in this way, when i update portfolio and account? Or I'm wrong?

Thanks!

braverock commented 3 years ago

You'll also need a GBPEUR currency exchange_rate defined.

Transactions of course happen in their native instruments/currencies.

An 'account' object also has a currency, so one of the slots in the account object will contain conversions to the account currency. Note that positions are in the traded instruments.