Skip to content

feat: add possibility to trade on a different price than the close price#35

Closed
xaviergilbert wants to merge 2 commits intomasterfrom
execution_price
Closed

feat: add possibility to trade on a different price than the close price#35
xaviergilbert wants to merge 2 commits intomasterfrom
execution_price

Conversation

@xaviergilbert
Copy link
Copy Markdown
Collaborator

@xaviergilbert xaviergilbert commented Jul 30, 2025

  • Add the possibility to execute trades on another price than the valuation price (eg. open) with the flag --file-parquet-column-execution-price
  • execute the orders before computing the valuation of the portfolio so the fees of the transaction are on the day of the execution

Comment thread bktest/backtest.py
Comment on lines +356 to +357
self.update_price(date)
self.exporters.fire_snapshot(date, self.account, None)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

todo: prices need to be updated before placing orders

Maybe this is problematic when taking opening prices?

Comment thread bktest/cli.py
allow_holidays=holidays,
holiday_provider=holiday_provider
holiday_provider=holiday_provider,
execution_prices = file_parquet_column_execution_price != None
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

nitpick: is not None

Comment thread bktest/price_provider.py
@xaviergilbert xaviergilbert deleted the execution_price branch March 3, 2026 11:42
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.

2 participants