Multi-asset backtesting framework. An intuitive API lets analysts try out their strategies right away

Overview

Epymetheus

Epymetheus: Multi-asset Backtesting Framework

python versions version CI codecov dl Code style: black

Documentation

Epymetheus is a multi-asset backtesting framework. It features an intuitive user API that lets analysts try out their trade strategies right away.

wealth

Installation

$ pip install epymetheus

Features

  1. Intuitive and Pythonic API
    • Epymetheus designs Pythonic API that lets you code your idea intuitively without any fuss.
    • Trading strategies can be readily coded as ordinary functions and then you can run() and score() it right away.
  2. Blazingly Fast Computation
    • Backtesting is boosted by NumPy and so you can give your own idea a quick try.
    • Executions of profit-taking and stop-loss orders are built-in.
  3. Seamless Connection with Pandas
    • You can use pandas.DataFrame of historical prices as the target of backtesting.
    • You can view the result of backtesting in Pandas format so that you can analyze and plot it using the familiar Pandas methods.
  4. Full Test Coverage:

Integrations

Your trading strategy may incorporate various libraries out there, for instance,

How to use

Open In Colab

Create strategy

Let's construct your trading strategy. The following "dumb strategy" will,

  • target a set of stocks whose DataFrame of historical prices is given by universe.
  • buy the cheapest stock with your monthly allowance $100, and
  • place a profit-taking order when your profit exceeds $profit_take and place a stop-loss order when your loss exceeds $stop_loss.

Here in the function dumb_strategy, the first argument universe is mandatory while the other arguments are parameters that you can define freely.

import pandas as pd
import epymetheus as ep


def dumb_strategy(universe: pd.DataFrame, profit_take, stop_loss):
    # I get $100 allowance on the first business day of each month
    allowance = 100

    for date in pd.date_range(universe.index[0], universe.index[-1], freq="BMS"):
        cheapest_stock = universe.loc[date].idxmin()

        # Find the maximum number of shares that I can buy with my allowance
        n_shares = allowance // universe.at[date, cheapest_stock]

        trade = n_shares * ep.trade(cheapest_stock, date, take=profit_take, stop=stop_loss)
        yield trade

You can now create your strategy with specific parameters as:

my_strategy = ep.create_strategy(dumb_strategy, profit_take=20.0, stop_loss=-10.0)

Run strategy

Now you can backtest your strategy with any universe, for instance, US stocks.

from epymetheus.datasets import fetch_usstocks

universe = fetch_usstocks()
universe.head()
#                 AAPL       MSFT     AMZN  BRK-A        JPM        JNJ        WMT        BAC         PG        XOM
# 2000-01-01  0.785456  37.162327  76.1250  56100  27.773939  27.289129  46.962898  14.527933  31.304089  21.492596
# 2000-01-02  0.785456  37.162327  76.1250  56100  27.773939  27.289129  46.962898  14.527933  31.304089  21.492596
# 2000-01-03  0.855168  37.102634  89.3750  54800  26.053429  26.978193  45.391777  14.021359  30.625511  20.892334
# 2000-01-04  0.783068  35.849308  81.9375  52000  25.481777  25.990519  43.693306  13.189125  30.036228  20.492161
# 2000-01-05  0.794528  36.227283  69.7500  53200  25.324482  26.264877  42.801613  13.333860  29.464787  21.609318
my_strategy.run(universe)
# 240 trades returned: trade(['BAC'], lot=[3.], entry=2019-12-02 00:00:00, take=20.0, stop=-10.0) ... Done. (Runtume: 0.1034 sec)
# 240 trades executed: trade(['BAC'], lot=[3.], entry=2019-12-02 00:00:00, take=20.0, stop=-10.0) ... Done. (Runtime: 0.2304 sec)
# Done. (Runtime: 0.3338 sec)

Trade history and wealth

Trade history can be viewed as:

df_history = my_strategy.history()
df_history.head()
#    trade_id asset    lot      entry      close  exit  take  stop        pnl
# 0         0  AAPL  115.0 2000-01-03 2005-01-07  None  20.0 -10.0  23.527901
# 1         1  AAPL  129.0 2000-02-01 2000-09-29  None  20.0 -10.0 -48.437450
# 2         2  AAPL   99.0 2000-03-01 2005-07-14  None  20.0 -10.0  24.924913
# 3         3  AAPL   97.0 2000-04-03 2005-07-14  None  20.0 -10.0  22.180065
# 4         4  AAPL  104.0 2000-05-01 2005-05-19  None  20.0 -10.0  20.736752

The time-series of wealth can be viewed as:

series_wealth = my_strategy.wealth()
series_wealth.head()
# 2000-01-01    0.000000
# 2000-01-02    0.000000
# 2000-01-03    0.000000
# 2000-01-04   -8.363557
# 2000-01-05   -7.034265
# Freq: D, dtype: float64

wealth

Scores

You can quickly score() the metrics of the strategy.

my_strategy.score("final_wealth")
# 3216.74
my_strategy.score("max_drawdown")
# -989.19

You may compute various time-series.

drawdown = my_strategy.drawdown()
exposure = my_strategy.net_exposure()

drawdown net_exposure

More examples

Optimization

You may optimize the parameters of your strategy using Optuna for example.

Remember that optimization for backtesting is dangerous.

import optuna


def objective(trial):
    profit_take = trial.suggest_int("profit_take", 10, 100)
    stop_loss = trial.suggest_int("stop_loss", -100, -10)

    my_strategy = ep.create_strategy(
        dumb_strategy,
        profit_take=profit_take,
        stop_loss=stop_loss,
    ).run(universe, verbose=False)

    return my_strategy.score("final_wealth")


study = optuna.create_study(direction="maximize")
study.optimize(objective, n_trials=100)

study.best_params
# {'profit_take': 100, 'stop_loss': -42}

Pair trading

Trade can include multiple stocks.

Profit-take and stop-loss will be executed when the total profit/loss exceed thresholds.

def pair_trading_strategy(universe, param_1, ...):
    ...
    # Buy 1 share of "BULLISH_STOCK" and sell 2 shares of "BEARISH_STOCK".
    yield [1, -2] * ep.trade(["BULLISH_STOCK", "BEARISH_STOCK"], stop=-100.0)

Contributing

Any contributions are more than welcome.

The maintainer (simaki) is not making further enhancements and appreciates pull requests to make them. See Issue for proposed features. Please take a look at CONTRIBUTING.md before creating a pull request.

Comments
  • Update pytest requirement from ^6.2.5 to ^7.0.0

    Update pytest requirement from ^6.2.5 to ^7.0.0

    Updates the requirements on pytest to permit the latest version.

    Release notes

    Sourced from pytest's releases.

    7.0.0

    pytest 7.0.0 (2022-02-03)

    (Please see the full set of changes for this release also in the 7.0.0rc1 notes below)

    Deprecations

    • #9488: If custom subclasses of nodes like pytest.Item{.interpreted-text role="class"} override the __init__ method, they should take **kwargs. See uncooperative-constructors-deprecated{.interpreted-text role="ref"} for details.

      Note that a deprection warning is only emitted when there is a conflict in the arguments pytest expected to pass. This deprecation was already part of pytest 7.0.0rc1 but wasn't documented.

    Bug Fixes

    • #9355: Fixed error message prints function decorators when using assert in Python 3.8 and above.
    • #9396: Ensure pytest.Config.inifile{.interpreted-text role="attr"} is available during the pytest_cmdline_main <_pytest.hookspec.pytest_cmdline_main>{.interpreted-text role="func"} hook (regression during 7.0.0rc1).

    Improved Documentation

    • #9404: Added extra documentation on alternatives to common misuses of [pytest.warns(None)]{.title-ref} ahead of its deprecation.
    • #9505: Clarify where the configuration files are located. To avoid confusions documentation mentions that configuration file is located in the root of the repository.

    Trivial/Internal Changes

    • #9521: Add test coverage to assertion rewrite path.

    pytest 7.0.0rc1 (2021-12-06)

    Breaking Changes

    • #7259: The Node.reportinfo() <non-python tests>{.interpreted-text role="ref"} function first return value type has been expanded from [py.path.local | str]{.title-ref} to [os.PathLike[str] | str]{.title-ref}.

      Most plugins which refer to [reportinfo()]{.title-ref} only define it as part of a custom pytest.Item{.interpreted-text role="class"} implementation. Since [py.path.local]{.title-ref} is a [os.PathLike[str]]{.title-ref}, these plugins are unaffacted.

      Plugins and users which call [reportinfo()]{.title-ref}, use the first return value and interact with it as a [py.path.local]{.title-ref}, would need to adjust by calling [py.path.local(fspath)]{.title-ref}. Although preferably, avoid the legacy [py.path.local]{.title-ref} and use [pathlib.Path]{.title-ref}, or use [item.location]{.title-ref} or [item.path]{.title-ref}, instead.

      Note: pytest was not able to provide a deprecation period for this change.

    ... (truncated)

    Commits
    • 3554b83 Add note to changelog
    • 6ea7f99 Prepare release version 7.0.0
    • 737b220 [7.0.x] releasing: Add template for major releases (#9597)
    • 7fa3972 [7.0.x] releasing: Always set doc_version (#9590)
    • b304499 [7.0.x] Make 'warnings' and 'deselected' in assert_outcomes optional (#9566)
    • f17525d [7.0.x] doc: Add ellipsis to warning usecase list (#9562)
    • 0a7be97 ci: Bump up timeout (#9565)
    • c17908c [7.0.x] doc: Recategorize 7.0.0 changelog items (#9564)
    • ab549bb [7.0.x] Add missing cooperative constructor changelog (#9563)
    • 4b1707f [7.0.x] Autouse linearization graph (#9557)
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • Update pandas-datareader requirement from ^0.9.0 to >=0.9,<0.11

    Update pandas-datareader requirement from ^0.9.0 to >=0.9,<0.11

    Updates the requirements on pandas-datareader to permit the latest version.

    Release notes

    Sourced from pandas-datareader's releases.

    Release 0.10.0

    The pandas datareader maintainers and contributors are happy to announce the release of 0.10.0. The notable features are:

    • Fixed Yahoo readers which now require headers
    • Fixed other reader
    • Improved compatibility with pandas
    Commits
    • e3b3db5 Merge pull request #888 from bashtage/release-0.10.0
    • bcfd080 RLS: Release 0.10.0
    • 6846ba1 Merge pull request #887 from bashtage/final-fixes
    • 7de905d MAINT: Final fixes
    • 06446e2 Merge pull request #886 from bashtage/clean-readme
    • 413dd3a MAINT: Clean README
    • 573dd97 Merge pull request #885 from bashtage/remove-parallel
    • 5ab2e3b MAINT: Remove paralle for Azure
    • 638b9da Merge pull request #884 from bashtage/add-azure-ci
    • c1b92c8 MAINT: Add AzureCi and prepare for 0.10 release
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.

    Dependabot will merge this PR once CI passes on it, as requested by @simaki.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 2
  • Update pytest requirement from ^6.2.5 to ^7.0.1

    Update pytest requirement from ^6.2.5 to ^7.0.1

    Updates the requirements on pytest to permit the latest version.

    Release notes

    Sourced from pytest's releases.

    7.0.1

    pytest 7.0.1 (2022-02-11)

    Bug Fixes

    • #9608: Fix invalid importing of importlib.readers in Python 3.9.
    • #9610: Restore [UnitTestFunction.obj]{.title-ref} to return unbound rather than bound method. Fixes a crash during a failed teardown in unittest TestCases with non-default [__init__]{.title-ref}. Regressed in pytest 7.0.0.
    • #9636: The pythonpath plugin was renamed to python_path. This avoids a conflict with the pytest-pythonpath plugin.
    • #9642: Fix running tests by id with :: in the parametrize portion.
    • #9643: Delay issuing a ~pytest.PytestWarning{.interpreted-text role="class"} about diamond inheritance involving ~pytest.Item{.interpreted-text role="class"} and ~pytest.Collector{.interpreted-text role="class"} so it can be filtered using standard warning filters <warnings>{.interpreted-text role="ref"}.
    Commits
    • 3f12087 [pre-commit.ci] auto fixes from pre-commit.com hooks
    • bc3021c Prepare release version 7.0.1
    • 591d476 Merge pull request #9673 from nicoddemus/backport-9511
    • 6ca733e Enable testing with Python 3.11 (#9511)
    • ac37b1b Merge pull request #9671 from nicoddemus/backport-9668
    • c891e40 Merge pull request #9672 from nicoddemus/backport-9669
    • e2753a2 Merge pull request #9669 from hugovk/ci-only-update-plugin-list-for-upstream
    • b5a154c Merge pull request #9668 from hugovk/test-me-latest-3.10
    • 0fae45b Merge pull request #9660 from pytest-dev/backport-9646-to-7.0.x
    • 37d434f [7.0.x] Delay warning about collector/item diamond inheritance
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Update black requirement from ^21.11b1 to ^22.1

    Update black requirement from ^21.11b1 to ^22.1

    Updates the requirements on black to permit the latest version.

    Release notes

    Sourced from black's releases.

    22.1.0

    At long last, Black is no longer a beta product! This is the first non-beta release and the first release covered by our new stability policy.

    Highlights

    • Remove Python 2 support (#2740)
    • Introduce the --preview flag (#2752)

    Style

    • Deprecate --experimental-string-processing and move the functionality under --preview (#2789)
    • For stubs, one blank line between class attributes and methods is now kept if there's at least one pre-existing blank line (#2736)
    • Black now normalizes string prefix order (#2297)
    • Remove spaces around power operators if both operands are simple (#2726)
    • Work around bug that causes unstable formatting in some cases in the presence of the magic trailing comma (#2807)
    • Use parentheses for attribute access on decimal float and int literals (#2799)
    • Don't add whitespace for attribute access on hexadecimal, binary, octal, and complex literals (#2799)
    • Treat blank lines in stubs the same inside top-level if statements (#2820)
    • Fix unstable formatting with semicolons and arithmetic expressions (#2817)
    • Fix unstable formatting around magic trailing comma (#2572)

    Parser

    • Fix mapping cases that contain as-expressions, like case {"key": 1 | 2 as password} (#2686)
    • Fix cases that contain multiple top-level as-expressions, like case 1 as a, 2 as b (#2716)
    • Fix call patterns that contain as-expressions with keyword arguments, like case Foo(bar=baz as quux) (#2749)
    • Tuple unpacking on return and yield constructs now implies 3.8+ (#2700)
    • Unparenthesized tuples on annotated assignments (e.g values: Tuple[int, ...] = 1, 2, 3) now implies 3.8+ (#2708)
    • Fix handling of standalone match() or case() when there is a trailing newline or a comment inside of the parentheses. (#2760)
    • from __future__ import annotations statement now implies Python 3.7+ (#2690)

    Performance

    • Speed-up the new backtracking parser about 4X in general (enabled when --target-version is set to 3.10 and higher). (#2728)
    • Black is now compiled with mypyc for an overall 2x speed-up. 64-bit Windows, MacOS, and Linux (not including musl) are supported. (#1009, #2431)

    Configuration

    • Do not accept bare carriage return line endings in pyproject.toml (#2408)
    • Add configuration option (python-cell-magics) to format cells with custom magics in Jupyter Notebooks (#2744)
    • Allow setting custom cache directory on all platforms with environment variable BLACK_CACHE_DIR (#2739).
    • Enable Python 3.10+ by default, without any extra need to specify --target-version=py310. (#2758)
    • Make passing SRC or --code mandatory and mutually exclusive (#2804)

    Output

    • Improve error message for invalid regular expression (#2678)
    • Improve error message when parsing fails during AST safety check by embedding the underlying SyntaxError (#2693)
    • No longer color diff headers white as it's unreadable in light themed terminals (#2691)
    • Text coloring added in the final statistics (#2712)
    • Verbose mode also now describes how a project root was discovered and which paths will be formatted. (#2526)

    Packaging

    • All upper version bounds on dependencies have been removed (#2718)
    • typing-extensions is no longer a required dependency in Python 3.10+ (#2772)
    • Set click lower bound to 8.0.0 as Black crashes on 7.1.2 (#2791)

    ... (truncated)

    Changelog

    Sourced from black's changelog.

    22.1.0

    At long last, Black is no longer a beta product! This is the first non-beta release and the first release covered by our new stability policy.

    Highlights

    • Remove Python 2 support (#2740)
    • Introduce the --preview flag (#2752)

    Style

    • Deprecate --experimental-string-processing and move the functionality under --preview (#2789)
    • For stubs, one blank line between class attributes and methods is now kept if there's at least one pre-existing blank line (#2736)
    • Black now normalizes string prefix order (#2297)
    • Remove spaces around power operators if both operands are simple (#2726)
    • Work around bug that causes unstable formatting in some cases in the presence of the magic trailing comma (#2807)
    • Use parentheses for attribute access on decimal float and int literals (#2799)
    • Don't add whitespace for attribute access on hexadecimal, binary, octal, and complex literals (#2799)
    • Treat blank lines in stubs the same inside top-level if statements (#2820)
    • Fix unstable formatting with semicolons and arithmetic expressions (#2817)
    • Fix unstable formatting around magic trailing comma (#2572)

    Parser

    • Fix mapping cases that contain as-expressions, like case {"key": 1 | 2 as password} (#2686)
    • Fix cases that contain multiple top-level as-expressions, like case 1 as a, 2 as b (#2716)
    • Fix call patterns that contain as-expressions with keyword arguments, like case Foo(bar=baz as quux) (#2749)
    • Tuple unpacking on return and yield constructs now implies 3.8+ (#2700)
    • Unparenthesized tuples on annotated assignments (e.g values: Tuple[int, ...] = 1, 2, 3) now implies 3.8+ (#2708)
    • Fix handling of standalone match() or case() when there is a trailing newline or a comment inside of the parentheses. (#2760)
    • from __future__ import annotations statement now implies Python 3.7+ (#2690)

    Performance

    • Speed-up the new backtracking parser about 4X in general (enabled when --target-version is set to 3.10 and higher). (#2728)
    • Black is now compiled with mypyc for an overall 2x speed-up. 64-bit Windows, MacOS, and Linux (not including musl) are supported. (#1009, #2431)

    ... (truncated)

    Commits

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Update pytest-cov requirement from ^2.8.1 to ^3.0.0

    Update pytest-cov requirement from ^2.8.1 to ^3.0.0

    Updates the requirements on pytest-cov to permit the latest version.

    Changelog

    Sourced from pytest-cov's changelog.

    3.0.0 (2021-10-04)

    Note that this release drops support for Python 2.7 and Python 3.5.

    • Added support for Python 3.10 and updated various test dependencies. Contributed by Hugo van Kemenade in [#500](https://github.com/pytest-dev/pytest-cov/issues/500) <https://github.com/pytest-dev/pytest-cov/pull/500>_.
    • Switched from Travis CI to GitHub Actions. Contributed by Hugo van Kemenade in [#494](https://github.com/pytest-dev/pytest-cov/issues/494) <https://github.com/pytest-dev/pytest-cov/pull/494>_ and [#495](https://github.com/pytest-dev/pytest-cov/issues/495) <https://github.com/pytest-dev/pytest-cov/pull/495>_.
    • Add a --cov-reset CLI option. Contributed by Danilo Šegan in [#459](https://github.com/pytest-dev/pytest-cov/issues/459) <https://github.com/pytest-dev/pytest-cov/pull/459>_.
    • Improved validation of --cov-fail-under CLI option. Contributed by ... Ronny Pfannschmidt's desire for skark in [#480](https://github.com/pytest-dev/pytest-cov/issues/480) <https://github.com/pytest-dev/pytest-cov/pull/480>_.
    • Dropped Python 2.7 support. Contributed by Thomas Grainger in [#488](https://github.com/pytest-dev/pytest-cov/issues/488) <https://github.com/pytest-dev/pytest-cov/pull/488>_.
    • Updated trove classifiers. Contributed by Michał Bielawski in [#481](https://github.com/pytest-dev/pytest-cov/issues/481) <https://github.com/pytest-dev/pytest-cov/pull/481>_.

    2.13.0 (2021-06-01)

    • Changed the toml requirement to be always be directly required (instead of being required through a coverage extra). This fixes issues with pip-compile (pip-tools#1300 <https://github.com/jazzband/pip-tools/issues/1300>). Contributed by Sorin Sbarnea in [#472](https://github.com/pytest-dev/pytest-cov/issues/472) <https://github.com/pytest-dev/pytest-cov/pull/472>.
    • Documented show_contexts. Contributed by Brian Rutledge in [#473](https://github.com/pytest-dev/pytest-cov/issues/473) <https://github.com/pytest-dev/pytest-cov/pull/473>_.

    2.12.1 (2021-06-01)

    • Changed the toml requirement to be always be directly required (instead of being required through a coverage extra). This fixes issues with pip-compile (pip-tools#1300 <https://github.com/jazzband/pip-tools/issues/1300>). Contributed by Sorin Sbarnea in [#472](https://github.com/pytest-dev/pytest-cov/issues/472) <https://github.com/pytest-dev/pytest-cov/pull/472>.
    • Documented show_contexts. Contributed by Brian Rutledge in [#473](https://github.com/pytest-dev/pytest-cov/issues/473) <https://github.com/pytest-dev/pytest-cov/pull/473>_.

    2.12.0 (2021-05-14)

    • Added coverage's toml extra to install requirements in setup.py. Contributed by Christian Riedel in [#410](https://github.com/pytest-dev/pytest-cov/issues/410) <https://github.com/pytest-dev/pytest-cov/pull/410>_.
    • Fixed pytest_cov.__version__ to have the right value (string with version instead of a string including __version__ =).

    ... (truncated)

    Commits
    • 560b955 Bump version: 2.12.1 → 3.0.0
    • e988a6c Update changelog.
    • f015932 Merge pull request #500 from hugovk/add-3.10
    • 60a3cc1 No need to build universal wheels for Python 3-only
    • 0bc997a Add support for Python 3.10
    • 679935b Merge pull request #494 from hugovk/test-on-github-actions
    • 96f9aad Add 'all good' job to be added as a required build
    • 6395ece Test conditional collection on PyPy and CPython
    • f4a88d6 Test both PyPy3.6 and PyPy3.7
    • a948e89 Test both PyPy3.6 and PyPy3.7
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Update pytest-cov requirement from ^2.8.1 to ^3.0.0

    Update pytest-cov requirement from ^2.8.1 to ^3.0.0

    Updates the requirements on pytest-cov to permit the latest version.

    Changelog

    Sourced from pytest-cov's changelog.

    3.0.0 (2021-10-04)

    Note that this release drops support for Python 2.7 and Python 3.5.

    • Added support for Python 3.10 and updated various test dependencies. Contributed by Hugo van Kemenade in [#500](https://github.com/pytest-dev/pytest-cov/issues/500) <https://github.com/pytest-dev/pytest-cov/pull/500>_.
    • Switched from Travis CI to GitHub Actions. Contributed by Hugo van Kemenade in [#494](https://github.com/pytest-dev/pytest-cov/issues/494) <https://github.com/pytest-dev/pytest-cov/pull/494>_ and [#495](https://github.com/pytest-dev/pytest-cov/issues/495) <https://github.com/pytest-dev/pytest-cov/pull/495>_.
    • Add a --cov-reset CLI option. Contributed by Danilo Šegan in [#459](https://github.com/pytest-dev/pytest-cov/issues/459) <https://github.com/pytest-dev/pytest-cov/pull/459>_.
    • Improved validation of --cov-fail-under CLI option. Contributed by ... Ronny Pfannschmidt's desire for skark in [#480](https://github.com/pytest-dev/pytest-cov/issues/480) <https://github.com/pytest-dev/pytest-cov/pull/480>_.
    • Dropped Python 2.7 support. Contributed by Thomas Grainger in [#488](https://github.com/pytest-dev/pytest-cov/issues/488) <https://github.com/pytest-dev/pytest-cov/pull/488>_.
    • Updated trove classifiers. Contributed by Michał Bielawski in [#481](https://github.com/pytest-dev/pytest-cov/issues/481) <https://github.com/pytest-dev/pytest-cov/pull/481>_.

    2.13.0 (2021-06-01)

    • Changed the toml requirement to be always be directly required (instead of being required through a coverage extra). This fixes issues with pip-compile (pip-tools#1300 <https://github.com/jazzband/pip-tools/issues/1300>). Contributed by Sorin Sbarnea in [#472](https://github.com/pytest-dev/pytest-cov/issues/472) <https://github.com/pytest-dev/pytest-cov/pull/472>.
    • Documented show_contexts. Contributed by Brian Rutledge in [#473](https://github.com/pytest-dev/pytest-cov/issues/473) <https://github.com/pytest-dev/pytest-cov/pull/473>_.

    2.12.1 (2021-06-01)

    • Changed the toml requirement to be always be directly required (instead of being required through a coverage extra). This fixes issues with pip-compile (pip-tools#1300 <https://github.com/jazzband/pip-tools/issues/1300>). Contributed by Sorin Sbarnea in [#472](https://github.com/pytest-dev/pytest-cov/issues/472) <https://github.com/pytest-dev/pytest-cov/pull/472>.
    • Documented show_contexts. Contributed by Brian Rutledge in [#473](https://github.com/pytest-dev/pytest-cov/issues/473) <https://github.com/pytest-dev/pytest-cov/pull/473>_.

    2.12.0 (2021-05-14)

    • Added coverage's toml extra to install requirements in setup.py. Contributed by Christian Riedel in [#410](https://github.com/pytest-dev/pytest-cov/issues/410) <https://github.com/pytest-dev/pytest-cov/pull/410>_.
    • Fixed pytest_cov.__version__ to have the right value (string with version instead of a string including __version__ =).

    ... (truncated)

    Commits
    • 560b955 Bump version: 2.12.1 → 3.0.0
    • e988a6c Update changelog.
    • f015932 Merge pull request #500 from hugovk/add-3.10
    • 60a3cc1 No need to build universal wheels for Python 3-only
    • 0bc997a Add support for Python 3.10
    • 679935b Merge pull request #494 from hugovk/test-on-github-actions
    • 96f9aad Add 'all good' job to be added as a required build
    • 6395ece Test conditional collection on PyPy and CPython
    • f4a88d6 Test both PyPy3.6 and PyPy3.7
    • a948e89 Test both PyPy3.6 and PyPy3.7
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Update pandas-datareader requirement from ^0.9.0 to >=0.9,<0.11

    Update pandas-datareader requirement from ^0.9.0 to >=0.9,<0.11

    ⚠️ Dependabot is rebasing this PR ⚠️

    Rebasing might not happen immediately, so don't worry if this takes some time.

    Note: if you make any changes to this PR yourself, they will take precedence over the rebase.


    Updates the requirements on pandas-datareader to permit the latest version.

    Release notes

    Sourced from pandas-datareader's releases.

    Release 0.10.0

    The pandas datareader maintainers and contributors are happy to announce the release of 0.10.0. The notable features are:

    • Fixed Yahoo readers which now require headers
    • Fixed other reader
    • Improved compatibility with pandas
    Commits
    • e3b3db5 Merge pull request #888 from bashtage/release-0.10.0
    • bcfd080 RLS: Release 0.10.0
    • 6846ba1 Merge pull request #887 from bashtage/final-fixes
    • 7de905d MAINT: Final fixes
    • 06446e2 Merge pull request #886 from bashtage/clean-readme
    • 413dd3a MAINT: Clean README
    • 573dd97 Merge pull request #885 from bashtage/remove-parallel
    • 5ab2e3b MAINT: Remove paralle for Azure
    • 638b9da Merge pull request #884 from bashtage/add-azure-ci
    • c1b92c8 MAINT: Add AzureCi and prepare for 0.10 release
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • Update pandas-datareader requirement from ^0.9.0 to >=0.9,<0.11

    Update pandas-datareader requirement from ^0.9.0 to >=0.9,<0.11

    Updates the requirements on pandas-datareader to permit the latest version.

    Release notes

    Sourced from pandas-datareader's releases.

    Release 0.10.0

    The pandas datareader maintainers and contributors are happy to announce the release of 0.10.0. The notable features are:

    • Fixed Yahoo readers which now require headers
    • Fixed other reader
    • Improved compatibility with pandas
    Commits
    • e3b3db5 Merge pull request #888 from bashtage/release-0.10.0
    • bcfd080 RLS: Release 0.10.0
    • 6846ba1 Merge pull request #887 from bashtage/final-fixes
    • 7de905d MAINT: Final fixes
    • 06446e2 Merge pull request #886 from bashtage/clean-readme
    • 413dd3a MAINT: Clean README
    • 573dd97 Merge pull request #885 from bashtage/remove-parallel
    • 5ab2e3b MAINT: Remove paralle for Azure
    • 638b9da Merge pull request #884 from bashtage/add-azure-ci
    • c1b92c8 MAINT: Add AzureCi and prepare for 0.10 release
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • How to pass in OHLC data

    How to pass in OHLC data

    Hi,

    First, thanks for developing this cool backtester. Can't wait to try it out. This is more of a question, not an issue. How could I pass OHLC data into the strategy? I have only found this example: universe = pd.DataFrame({"AAPL": [100, 101], "AMZN": [200, 201]}) So it seems it's only one price, e.g. close or adjclose. Please let me know.

    opened by justmobiledev 0
  • Update pytest-cov requirement from ^3.0.0 to ^4.0.0

    Update pytest-cov requirement from ^3.0.0 to ^4.0.0

    Updates the requirements on pytest-cov to permit the latest version.

    Changelog

    Sourced from pytest-cov's changelog.

    4.0.0 (2022-09-28)

    Note that this release drops support for multiprocessing.

    • --cov-fail-under no longer causes pytest --collect-only to fail Contributed by Zac Hatfield-Dodds in [#511](https://github.com/pytest-dev/pytest-cov/issues/511) <https://github.com/pytest-dev/pytest-cov/pull/511>_.

    • Dropped support for multiprocessing (mostly because issue 82408 <https://github.com/python/cpython/issues/82408>_). This feature was mostly working but very broken in certain scenarios and made the test suite very flaky and slow.

      There is builtin multiprocessing support in coverage and you can migrate to that. All you need is this in your .coveragerc::

      [run] concurrency = multiprocessing parallel = true sigterm = true

    • Fixed deprecation in setup.py by trying to import setuptools before distutils. Contributed by Ben Greiner in [#545](https://github.com/pytest-dev/pytest-cov/issues/545) <https://github.com/pytest-dev/pytest-cov/pull/545>_.

    • Removed undesirable new lines that were displayed while reporting was disabled. Contributed by Delgan in [#540](https://github.com/pytest-dev/pytest-cov/issues/540) <https://github.com/pytest-dev/pytest-cov/pull/540>_.

    • Documentation fixes. Contributed by Andre Brisco in [#543](https://github.com/pytest-dev/pytest-cov/issues/543) <https://github.com/pytest-dev/pytest-cov/pull/543>_ and Colin O'Dell in [#525](https://github.com/pytest-dev/pytest-cov/issues/525) <https://github.com/pytest-dev/pytest-cov/pull/525>_.

    • Added support for LCOV output format via --cov-report=lcov. Only works with coverage 6.3+. Contributed by Christian Fetzer in [#536](https://github.com/pytest-dev/pytest-cov/issues/536) <https://github.com/pytest-dev/pytest-cov/issues/536>_.

    • Modernized pytest hook implementation. Contributed by Bruno Oliveira in [#549](https://github.com/pytest-dev/pytest-cov/issues/549) <https://github.com/pytest-dev/pytest-cov/pull/549>_ and Ronny Pfannschmidt in [#550](https://github.com/pytest-dev/pytest-cov/issues/550) <https://github.com/pytest-dev/pytest-cov/pull/550>_.

    3.0.0 (2021-10-04)

    Note that this release drops support for Python 2.7 and Python 3.5.

    • Added support for Python 3.10 and updated various test dependencies. Contributed by Hugo van Kemenade in [#500](https://github.com/pytest-dev/pytest-cov/issues/500) <https://github.com/pytest-dev/pytest-cov/pull/500>_.
    • Switched from Travis CI to GitHub Actions. Contributed by Hugo van Kemenade in [#494](https://github.com/pytest-dev/pytest-cov/issues/494) <https://github.com/pytest-dev/pytest-cov/pull/494>_ and [#495](https://github.com/pytest-dev/pytest-cov/issues/495) <https://github.com/pytest-dev/pytest-cov/pull/495>_.
    • Add a --cov-reset CLI option. Contributed by Danilo Šegan in [#459](https://github.com/pytest-dev/pytest-cov/issues/459) <https://github.com/pytest-dev/pytest-cov/pull/459>_.
    • Improved validation of --cov-fail-under CLI option. Contributed by ... Ronny Pfannschmidt's desire for skark in [#480](https://github.com/pytest-dev/pytest-cov/issues/480) <https://github.com/pytest-dev/pytest-cov/pull/480>_.
    • Dropped Python 2.7 support.

    ... (truncated)

    Commits
    • 28db055 Bump version: 3.0.0 → 4.0.0
    • 57e9354 Really update the changelog.
    • 56b810b Update chagelog.
    • f7fced5 Add support for LCOV output
    • 1211d31 Fix flake8 error
    • b077753 Use modern approach to specify hook options
    • 00713b3 removed incorrect docs on data_file.
    • b3dda36 Improve workflow with a collecting status check. (#548)
    • 218419f Prevent undesirable new lines to be displayed when report is disabled
    • 60b73ec migrate build command from distutils to setuptools
    • Additional commits viewable in compare view

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies 
    opened by dependabot[bot] 1
  • DOC: Fix Documentation

    DOC: Fix Documentation

    • [x] create_strategy
    • [x] trade
    • [ ] Strategy
    • [ ] Trade
    • [x] make_randomwalk
    • [ ] fetch_usstocks
    • [ ] check_trade
    • [ ] dumb_strategy
    • [ ] BuyAndHold
    • [ ] DeterminedStrategy
    • [ ] RandomStrategy
    • [ ] StrategyList
    • [ ] StrategyDict
    documentation 
    opened by simaki 0
Releases(0.17.1)
py.test fixture for benchmarking code

Overview docs tests package A pytest fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. See c

Ionel Cristian Mărieș 1k Jan 03, 2023
MultiPy lets you conveniently keep track of your python scripts for personal use or showcase by loading and grouping them into categories. It allows you to either run each script individually or together with just one click.

MultiPy About MultiPy is a graphical user interface built using Dear PyGui Python GUI Framework that lets you conveniently keep track of your python s

56 Oct 29, 2022
Testing Calculations in Python, using OOP (Object-Oriented Programming)

Testing Calculations in Python, using OOP (Object-Oriented Programming) Create environment with venv python3 -m venv venv Activate environment . venv

William Koller 1 Nov 11, 2021
To automate the generation and validation tests of COSE/CBOR Codes and it's base45/2D Code representations

To automate the generation and validation tests of COSE/CBOR Codes and it's base45/2D Code representations, a lot of data has to be collected to ensure the variance of the tests. This respository was

160 Jul 25, 2022
Useful additions to Django's default TestCase

django-test-plus Useful additions to Django's default TestCase from REVSYS Rationale Let's face it, writing tests isn't always fun. Part of the reason

REVSYS 546 Dec 22, 2022
An Instagram bot that can mass text users, receive and read a text, and store it somewhere with user details.

Instagram Bot 🤖 July 14, 2021 Overview 👍 A multifunctionality automated instagram bot that can mass text users, receive and read a message and store

Abhilash Datta 14 Dec 06, 2022
FaceBot is a script to automatically create a facebook account using the selenium and chromedriver modules.

FaceBot is a script to automatically create a facebook account using the selenium and chromedriver modules. That way, we don't need to input full name, email and password and date of birth. All will

Fadjrir Herlambang 2 Jun 17, 2022
MongoDB panel for the Flask Debug Toolbar

Flask Debug Toolbar MongoDB Panel Info: An extension panel for Rob Hudson's Django Debug Toolbar that adds MongoDB debugging information Author: Harry

Cenk Altı 4 Dec 11, 2019
Selects tests affected by changed files. Continous test runner when used with pytest-watch.

This is a pytest plug-in which automatically selects and re-executes only tests affected by recent changes. How is this possible in dynamic language l

Tibor Arpas 614 Dec 30, 2022
Baseball Discord bot that can post up-to-date scores, lineups, and home runs.

Sunny Day Discord Bot Baseball Discord bot that can post up-to-date scores, lineups, and home runs. Uses webscraping techniques to scrape baseball dat

Benjamin Hammack 1 Jun 20, 2022
Ab testing - The using AB test to test of difference of conversion rate

Facebook recently introduced a new type of offer that is an alternative to the current type of bidding called maximum bidding he introduced average bidding.

5 Nov 21, 2022
Python 3 wrapper of Microsoft UIAutomation. Support UIAutomation for MFC, WindowsForm, WPF, Modern UI(Metro UI), Qt, IE, Firefox, Chrome ...

Python 3 wrapper of Microsoft UIAutomation. Support UIAutomation for MFC, WindowsForm, WPF, Modern UI(Metro UI), Qt, IE, Firefox, Chrome ...

yin kaisheng 1.6k Dec 29, 2022
A small automated test structure using python to test *.cpp codes

Get Started Insert C++ Codes Add Test Code Run Test Samples Check Coverages Insert C++ Codes you can easily add c++ files in /inputs directory there i

Alireza Zahiri 2 Aug 03, 2022
Ab testing - basically a statistical test in which two or more variants

Ab testing - basically a statistical test in which two or more variants

Buse Yıldırım 5 Mar 13, 2022
Integration layer between Requests and Selenium for automation of web actions.

Requestium is a Python library that merges the power of Requests, Selenium, and Parsel into a single integrated tool for automatizing web actions. The

Tryolabs 1.7k Dec 27, 2022
Test scripts etc. for experimental rollup testing

rollup node experiments Test scripts etc. for experimental rollup testing. untested, work in progress python -m venv venv source venv/bin/activate #

Diederik Loerakker 14 Jan 25, 2022
Docker-based integration tests

Docker-based integration tests Description Simple pytest fixtures that help you write integration tests with Docker and docker-compose. Specify all ne

Avast 326 Dec 27, 2022
Playwright Python tool practice pytest pytest-bdd screen-play page-object allure cucumber-report

pytest-ui-automatic Playwright Python tool practice pytest pytest-bdd screen-play page-object allure cucumber-report How to run Run tests execute_test

moyu6027 11 Nov 08, 2022
Load Testing ML Microservices for Robustness and Scalability

The demo is aimed at getting started with load testing a microservice before taking it to production. We use FastAPI microservice (to predict weather) and Locust to load test the service (locally or

Emmanuel Raj 13 Jul 05, 2022
Pytest plugin for testing the idempotency of a function.

pytest-idempotent Pytest plugin for testing the idempotency of a function. Usage pip install pytest-idempotent Documentation Suppose we had the follo

Tyler Yep 3 Dec 14, 2022