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

Can ta4j backtest trading multiple stocks simultaneously #1128

Open
cx14 opened this issue Jan 7, 2024 · 2 comments
Open

Can ta4j backtest trading multiple stocks simultaneously #1128

cx14 opened this issue Jan 7, 2024 · 2 comments
Labels

Comments

@cx14
Copy link

cx14 commented Jan 7, 2024

I use ta4j to backtest stock trading strategies. Can ta4j backtest trading multiple stocks simultaneously? For example, selecting stocks that meet the criteria from a basket of stocks and open trades. The reason for not backtesting stocks one by one is mainly due to capital limitations. For instance, on a certain day, multiple stocks are selected, but the remaining capital is not sufficient to open trades for all of them, so only a portion of the stocks can be traded. Once a trade is opened, it is checked whether it meets the closing conditions, and this process repeats.

@cx14 cx14 added the question label Jan 7, 2024
@TheCookieLab
Copy link
Member

TheCookieLab commented Jan 7, 2024

You can backtest multiple strategies/barseries in your client code via your preferred concurrency approach. As for your stated capital requirement logic, that too is specific enough to belong in your own client code.

@sgflt
Copy link
Contributor

sgflt commented Apr 21, 2024

Maybe it is better not to spend all capital to single stock and preserve space for another possible trades.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants