Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Currencies in backtest #164

Merged
merged 42 commits into from
Nov 29, 2024
Merged

Currencies in backtest #164

merged 42 commits into from
Nov 29, 2024

Conversation

eirik-thorp
Copy link
Collaborator

Introducing currencies in the backtest:

  • Each ticker and future contract now has a designated currency parameter.
  • Backtest porfolio has a designated currency.
  • Transactions are transacted in the ticker currency and the net liquidation of the portfolio is recorded in the portfolio currency by converting transaction costs and P/L using a set of currency exchange tickers.

Copy link

codecov bot commented Jun 4, 2024

Codecov Report

Attention: Patch coverage is 79.51807% with 17 lines in your changes missing coverage. Please review.

Project coverage is 77.06%. Comparing base (db26e2a) to head (6626c0d).
Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
qf_lib/common/tickers/tickers.py 76.00% 6 Missing ⚠️
...ata_providers/bloomberg/bloomberg_data_provider.py 50.00% 4 Missing ⚠️
qf_lib/data_providers/prefetching_data_provider.py 50.00% 3 Missing ⚠️
qf_lib/data_providers/exchange_rate_provider.py 80.00% 2 Missing ⚠️
qf_lib/backtesting/broker/backtest_broker.py 75.00% 1 Missing ⚠️
qf_lib/backtesting/portfolio/portfolio.py 95.45% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #164      +/-   ##
==========================================
+ Coverage   76.97%   77.06%   +0.09%     
==========================================
  Files         227      228       +1     
  Lines        9169     9215      +46     
==========================================
+ Hits         7058     7102      +44     
- Misses       2111     2113       +2     
Files with missing lines Coverage Δ
qf_lib/backtesting/broker/broker.py 76.92% <100.00%> (ø)
qf_lib/backtesting/order/order_factory.py 97.02% <100.00%> (-0.06%) ⬇️
...n_sizer/initial_risk_with_volume_position_sizer.py 94.64% <100.00%> (ø)
.../futures/future_tickers/bloomberg_future_ticker.py 87.87% <100.00%> (+0.78%) ⬆️
...containers/futures/future_tickers/future_ticker.py 86.29% <100.00%> (+0.11%) ⬆️
qf_lib/backtesting/broker/backtest_broker.py 88.88% <75.00%> (-3.12%) ⬇️
qf_lib/backtesting/portfolio/portfolio.py 98.98% <95.45%> (-1.02%) ⬇️
qf_lib/data_providers/exchange_rate_provider.py 80.00% <80.00%> (ø)
qf_lib/data_providers/prefetching_data_provider.py 78.94% <50.00%> (-5.43%) ⬇️
...ata_providers/bloomberg/bloomberg_data_provider.py 42.26% <50.00%> (+0.02%) ⬆️
... and 1 more

... and 1 file with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update db26e2a...6626c0d. Read the comment docs.

@eirik-thorp eirik-thorp marked this pull request as ready for review June 5, 2024 07:43
qf_lib/backtesting/broker/backtest_broker.py Outdated Show resolved Hide resolved
qf_lib/common/enums/currency.py Outdated Show resolved Hide resolved
qf_lib/backtesting/portfolio/portfolio.py Outdated Show resolved Hide resolved
qf_lib/backtesting/portfolio/portfolio.py Outdated Show resolved Hide resolved
qf_lib/common/tickers/exchange_rate_ticker.py Outdated Show resolved Hide resolved
qf_lib/common/tickers/exchange_rate_ticker.py Outdated Show resolved Hide resolved
qf_lib/common/tickers/exchange_rate_ticker.py Outdated Show resolved Hide resolved
qf_lib/backtesting/portfolio/portfolio.py Outdated Show resolved Hide resolved
qf_lib/backtesting/broker/broker.py Outdated Show resolved Hide resolved
qf_lib/backtesting/portfolio/portfolio.py Outdated Show resolved Hide resolved
qf_lib/backtesting/portfolio/portfolio.py Outdated Show resolved Hide resolved
qf_lib/common/tickers/tickers.py Outdated Show resolved Hide resolved
qf_lib/common/tickers/tickers.py Outdated Show resolved Hide resolved
qf_lib/data_providers/bloomberg/bloomberg_data_provider.py Outdated Show resolved Hide resolved
qf_lib/data_providers/prefetching_data_provider.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@zeynepgultugaydemir zeynepgultugaydemir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on fridays we merge

@myrmarachne myrmarachne merged commit eadf8df into master Nov 29, 2024
7 checks passed
@myrmarachne myrmarachne deleted the backtest-currency branch November 29, 2024 15:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants