Comments (5)
I've tested it on both: M1 Pro Max 32gb ram machine
And a separated Linux server.
I guess, it's just CPU super intensive and it never ends.
Is there a way to specify the granularity to be used for plots only? And for backtest still use 1m granularity?
from vectorbt.
Plotly is relatively slow when it comes to plotting high-granularity data. In VBT PRO you can resample entire object to a higher timeframe before plotting, but here you need to use more basic plots such as pf.value().vbt.plot() together with plotly-resampler.
from vectorbt.
I see, still trying to figure it out how to combine the two libreries to reduce from 1m to 1h granularity.
What about quantstats?
pf.qs.html_report(
download_filename=TEARSHEET_HTML,
output=TEARSHEET_HTML,
title=titleReport,
benchmark=pf.returns_acc.benchmark_rets,
)
How could I produce a quant-stats report re-sampling it to lower granularity?
from vectorbt.
I'm currently trying as follows:
resampled_benchmark_rets = pf.returns_acc.benchmark_rets.resample('h').last().ffill()
vbt.settings.array_wrapper['freq'] = 'h'
vbt.settings.returns['year_freq'] = '365d'
pf.get_qs(
freq='1h',
benchmark_rets=resampled_benchmark_rets,
).html_report(
download_filename=TEARSHEET_HTML,
output=TEARSHEET_HTML,
title=f'{symbol} Report',
returns=resampled_benchmark_rets,
)
Receiving the following error:
Error: save_quant_stats error ⚠️ operands could not be broadcast together with remapped shapes [original->remapped]: (54477,) and requested shape (3260371,)
Without resample, with 1m candlesticks it takes ~30min and it finally generates a 250MB html file that is way to heavy to be opened.
Any hint or suggestion is much appreciated.
from vectorbt.
resolved
from vectorbt.
Related Issues (20)
- vbt.CCXTData.pull HOT 2
- Lack of compatibility with python 3.12? HOT 6
- How to view the total net value trend of the entire strategy HOT 2
- Exits do not trigger consistently when using limit orders with from_signals HOT 2
- Custom sizing in portfolio.from_signals.
- ImportError: cannot import name 'generated_jit' from 'numba' HOT 9
- portfolio stats calculation for dca strategies. not appear all buy orders only first HOT 1
- Error specifying `benchmark_rets` arg in `Portfolio.plot_cum_returns()` HOT 2
- Doc Bug report HOT 1
- how to plot the trades of each symbol in portfolio HOT 1
- slippages are not applied to stop orders HOT 1
- How to import 3rd party data HOT 1
- Open short position right after closing long position with full capital HOT 3
- Installing vectorbt on Google Colab HOT 1
- portfolio.from_signals reporting HIGH variations with fees vs no fees
- set sl/tp to be triggered on exact values
- Portfolio.stats consumes large amount of memory. HOT 1
- Need to add requirement: nbformat>=4.2.0
- Vectorbt documentation code examples throws unsupported error. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vectorbt.