Skip to content

[WIP] Support multiple instruments(symbols) backtest #639

New issue

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

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

Already on GitHub? # to your account

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

robert1003
Copy link

@robert1003 robert1003 commented May 8, 2022

Fixes #20

An incomplete attempt to add multiple-symbol backtest, which is mentioned in #20. Not sure if this fits the current structure.

Lots of necessary changes haven't been done yet, including docs and code related graphing part.

@robert1003
Copy link
Author

robert1003 commented May 9, 2022

How do you think @kernc? If you think it is inappropriate I will withdraw it, thanks.

@AgarwalPragy
Copy link

It looks like the current attempt is not backwards compatible. For example, the signature of Strategy.position has changed from Position to dict[str, Position]. 😞

Maybe we can include a flag which enables multi-symbol mode and return Union[Position, dict[str, Position]] based on whether the mode is enabled or not?

@AgarwalPragy
Copy link

There is also something wrong with Broker.last_price and other functions.

@AgarwalPragy
Copy link

I've made a parallel attempt here #641

@luketych
Copy link

luketych commented Aug 2, 2022

How is this coming along?

@kernc kernc force-pushed the master branch 9 times, most recently from 60eff81 to 109c352 Compare November 28, 2022 22:33
@PabloCanovas
Copy link

PabloCanovas commented Mar 24, 2024

Not related in anyway with him but @dodid did an awesome job extending this backtesting.py library to his minitrade package which enables multiasset backtesting, check it out: https://github.com/dodid/minitrade

@kernc kernc force-pushed the master branch 5 times, most recently from 428c361 to 0ce6cab Compare January 21, 2025 07:25
@kernc kernc force-pushed the master branch 3 times, most recently from 70abc06 to c79ffb0 Compare February 17, 2025 01:32
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backtest multiple instruments at once
4 participants