Giter Club home page Giter Club logo

Comments (5)

fl0wo avatar fl0wo commented on May 25, 2024

I've tested it on both: M1 Pro Max 32gb ram machine
And a separated Linux server.

image

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.

polakowo avatar polakowo commented on May 25, 2024

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.

fl0wo avatar fl0wo commented on May 25, 2024

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.

fl0wo avatar fl0wo commented on May 25, 2024

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.

fl0wo avatar fl0wo commented on May 25, 2024

resolved

from vectorbt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.