Adding extra day before dtcmp calc, as otherwise the extradays
have no effect (#388)
Fixing the issue with TWS API Bust events (err code 10225) (#396)
Add support for ASK quotes for CASH assets (#395) plus fixes
Remove duplicated note (#386)
Fixing time.clock for python>=3.8 (#394)
Changed file initiation for WriterFile to make it work under
multi-process optimization (#397) plus fixes
Fixed backend loading if a backend is loaded (Google Collab) and
backend to use on MacOSX
Fix: crumb in feeds.YahooFinanceData (#400)
Fix color assignments, ticks line widths and some pep-8 improvements
Fix timeframe/compression detection when plotting
Fix default value for ticks display format on X-axis
Sample with ta-lib SAR test
Generic support of multiple "text/*" content types for Yahoo
@run-out said in How to create pyfolio round trip tearsheet?:
Hi @run-out I tried the QuantStats repo with your strategy, but I had an error:
Traceback (most recent call last):
File "main.py", line 14, in <module>
File "/Users/benjamincherion/Desktop/backtesting-cryptos/backtest.py", line 66, in backtest
File "/Users/benjamincherion/Library/Python/3.7/lib/python/site-packages/quantstats/stats.py", line 234, in sharpe
returns = _utils._prepare_returns(returns, rf, periods)
File "/Users/benjamincherion/Library/Python/3.7/lib/python/site-packages/quantstats/utils.py", line 200, in _prepare_returns
elif data.min() >= 0 and data.max() > 1:
AttributeError: 'dict' object has no attribute 'min'
the output of your strategy (to inject in QuantStats) is the following one:
datetime.datetime(2020, 4, 29, 0, 0): (100000.0, 100000.0),
datetime.datetime(2020, 4, 29, 4, 0): (100000.0, 100000.0),
datetime.datetime(2020, 8, 1, 0, 0): (811.8994327605933, 110828.6750226959)
is it possible to provide an example ?
Thanks a lot !
As a side note: using the information from the future is not a good idea in general ( it will definitely not work in real time trading).
Having said that it is still possible to get the future bar information in case the data feed /indicators are preloaded ( see the preload parameter for Cerebro engine https://www.backtrader.com/docu/cerebro/). Still need to be careful not to access the data feed index past the last preloaded bar.
Also I believe a similar question was already discussed in the following posts:
any many others