Skip to content

Error when plotting a large amount of data #35

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
thomasd3 opened this issue Jan 3, 2020 · 2 comments · Fixed by #47
Closed

Error when plotting a large amount of data #35

thomasd3 opened this issue Jan 3, 2020 · 2 comments · Fixed by #47
Labels
enhancement New feature or request

Comments

@thomasd3
Copy link

thomasd3 commented Jan 3, 2020

I have a very simple test:

df=load_dataframe(r’./historical.xlsx')
df = df.set_index('date')

# the backtest is a strategy that does nothing for now
bt = Backtest(df, empty_strategy, cash=1, commission=.002)
bt.run()

# and the display simply
bt.plot()

with all the data, bt.plot() will fail with Javascript Error: Maximum call stack size exceeded.

if I add:

df = df[0:50000]

then the display works fine.

I have about 1.3M data points (and need them); is there a way to resample the data but ONLY for the display?

@thomasd3 thomasd3 changed the title Error when plotting a large number of data Error when plotting a large amount of data Jan 3, 2020
@thomasd3
Copy link
Author

thomasd3 commented Jan 3, 2020

I just realized that even with 50k data, it fails, but 20k is fine.

@kernc
Copy link
Owner

kernc commented Jan 3, 2020

is there a way to resample the data but ONLY for the display?

Not presently. I think the exact amount of data points might depend on available RAM and web browser configuration. Would certainly welcome automagically downsampling to a reasonable amount of candles for plot. 👍

@kernc kernc added the enhancement New feature or request label Jan 3, 2020
@kernc kernc closed this as completed in #47 Jul 15, 2020
Goblincomet pushed a commit to Goblincomet/forex-trading-backtest that referenced this issue Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants