Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[WIP] Feature: Support for multiple Instruments. #641

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

Closed
AgarwalPragy wants to merge 1 commit into kernc:master from AgarwalPragy:feature-multiple-instruments
Closed

[WIP] Feature: Support for multiple Instruments. #641

AgarwalPragy wants to merge 1 commit into kernc:master from AgarwalPragy:feature-multiple-instruments

Conversation

Copy link

@AgarwalPragy AgarwalPragy commented May 9, 2022
edited
Loading

An incomplete attempt to add multiple-instrument backtest, which is mentioned in #20 and #418

Aim: full backwards compatibility

How?
class Backtest will accept data as either a pd.DataFrame or a dictionary containing instrument names (str) and corresponding instrument data (pd.DataFrame). class _Data will follow suit.

class _Data will get a property is_single_instrument which tells us if the single-instrument-mode is enabled.

Internally, all classes will assume that the data is in multi-instrument mode. However, the signatures for methods in the existing API will be extended to return dictionaries instead of single-value if the multi-instrument mode is enabled.

Copy link
Author

A parallel effort for the same feature by Robert: #639

Copy link
Author

AgarwalPragy commented May 9, 2022
edited
Loading

@kernc would you be willing to accept this PR (once complete)? If you have a better way in mind, please let me know :)

racinger reacted with thumbs up emoji

Copy link

tumma72 commented May 24, 2022

Wouldn't it be better to have a _Data structure which allow to have multiple _Data with the name of the instrument, within which the _Array will still contain the various Series data. This way the .data.INSTRUMENT.Close will provide the most accurate data for the back testing and you could cycle through the instruments... It seems less complicated to me, and it will incapsulate the complexity.

Copy link

luketych commented Aug 2, 2022
edited
Loading

How is this coming along? @tumma72 @AgarwalPragy

1 similar comment
Copy link

luketych commented Aug 2, 2022

How is this coming along? @tumma72 @AgarwalPragy

Copy link

tumma72 commented Aug 11, 2022

To be honest, I gave up trying to bend the beast, and decided to create my own bot, which support backtesting, paper-trading and live-trading using the CCXT Library which works quite well with a number of Exchanges, and it is well maintained.

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

dodid commented Mar 17, 2023

I made an attempt to support multiple instruments based on kernc's excellent work. See https://github.com/dodid/minitrade The support is quite basic and feedback is welcome on how to make it more useful.

PabloCanovas and patricna reacted with heart emoji kernc reacted with rocket emoji kernc reacted with eyes emoji

@AgarwalPragy AgarwalPragy closed this by deleting the head repository Dec 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /