backtrader-lucidinvestor


Namebacktrader-lucidinvestor JSON
Version 1.9.7701 PyPI version JSON
download
home_pagehttps://gitlab.com/algorithmic-trading-library/backtrader
SummaryBackTesting Engine - maintained by LucidInvestor
upload_time2023-01-23 17:23:12
maintainer
docs_urlNone
authormaintainer: LucidInvestor
requires_python
licenseGPLv3+
keywords trading development
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            backtrader
**********

credits
#######

original author: Daniel Rodriguez (danjrod@gmail.com)
original unmaintained github: https://github.com/mementum/backtrader
alternative unmaintained github: https://github.com/backtrader2/backtrader

Tickets
#######

The ticket system is available at `LucidInvestor's public gitlab instance <https://gitlab.com/algorithmic-trading-library/backtrader/-/issues>`_.

Here a snippet of a Simple Moving Average CrossOver. It can be done in several
different ways. Use the docs (and examples) Luke!
::

  from datetime import datetime
  import backtrader as bt

  class SmaCross(bt.SignalStrategy):
      def __init__(self):
          sma1, sma2 = bt.ind.SMA(period=10), bt.ind.SMA(period=30)
          crossover = bt.ind.CrossOver(sma1, sma2)
          self.signal_add(bt.SIGNAL_LONG, crossover)

  cerebro = bt.Cerebro()
  cerebro.addstrategy(SmaCross)

  data0 = bt.feeds.YahooFinanceData(dataname='MSFT', fromdate=datetime(2011, 1, 1),
                                    todate=datetime(2012, 12, 31))
  cerebro.adddata(data0)

  cerebro.run()
  cerebro.plot()

Including a full featured chart. Give it a try! This is included in the samples
as ``sigsmacross/sigsmacross2.py``. Along it is ``sigsmacross.py`` which can be
parametrized from the command line.

Installation
############

``backtrader`` is self-contained with no external dependencies (except if you
want to plot)

From *pypi*:

  - ``pip install backtrader-lucidinvestor``

  - ``pip install backtrader[plotting]``

    If ``matplotlib`` is not installed and you wish to do some plotting

.. note:: The minimum matplotlib version is ``1.4.1``

An example for *IB* Data Feeds/Trading:

  - ``IbPy`` ``pip install IbPy-lucidinvestor``

For other functionalities like: ``Visual Chart``, ``Oanda``, ``TA-Lib``, check
the dependencies in the documentation.

From source:

  - Place the *backtrader* directory found in the sources inside your project

Python 2/3 Support
##################

  - Python >= ``3.2``

  - It also works with ``pypy`` and ``pypy3`` (no plotting - ``matplotlib`` is
    not supported under *pypy*)

Features
********

Live Trading and backtesting platform written in Python.

  - Live Data Feed and Trading with

    - Interactive Brokers (needs ``IbPy`` and benefits greatly from an
      installed ``pytz``)
    - *Visual Chart* (needs a fork of ``comtypes`` until a pull request is
      integrated in the release and benefits from ``pytz``)
    - *Oanda* (needs ``oandapy``) (REST API Only - v20 did not support
      streaming when implemented)

  - Data feeds from csv/files, online sources or from *pandas* and *blaze*
  - Filters for datas, like breaking a daily bar into chunks to simulate
    intraday or working with Renko bricks
  - Multiple data feeds and multiple strategies supported
  - Multiple timeframes at once
  - Integrated Resampling and Replaying
  - Step by Step backtesting or at once (except in the evaluation of the Strategy)
  - Integrated battery of indicators
  - *TA-Lib* indicator support (needs python *ta-lib* / check the docs)
  - Easy development of custom indicators
  - Analyzers (for example: TimeReturn, Sharpe Ratio, SQN) and ``pyfolio``
    integration (**deprecated**)
  - Flexible definition of commission schemes
  - Integrated broker simulation with *Market*, *Close*, *Limit*, *Stop*,
    *StopLimit*, *StopTrail*, *StopTrailLimit*and *OCO* orders, bracket order,
    slippage, volume filling strategies and continuous cash adjustmet for
    future-like instruments
  - Sizers for automated staking
  - Cheat-on-Close and Cheat-on-Open modes
  - Schedulers
  - Trading Calendars
  - Plotting (requires matplotlib)

Documentation
*************

The blog:

  - `Blog <http://www.backtrader.com/blog>`_

Read the full documentation at:

  - `Documentation <http://www.backtrader.com/docu>`_

List of built-in Indicators (122)

  - `Indicators Reference <http://www.backtrader.com/docu/indautoref.html>`_

Version numbering
*****************

X.Y.Z.I

  - X: Major version number. Should stay stable unless something big is changed
    like an overhaul to use ``numpy``
  - Y: Minor version number. To be changed upon adding a complete new feature or
    (god forbids) an incompatible API change.
  - Z: Revision version number. To be changed for documentation updates, small
    changes, small bug fixes
  - I: Number of Indicators already built into the platform

major Branches
##############

* **master**  - Merge from Develop. QA for full integration happens here.
  Contains the last tested/verified global code integration.
* **release** - Checkout from Master. Branch based on release & tags. Bug fix in checkout branches,
  and merge with others.
* **develop** - Checkout from Master / Pull.Req from Develop. Develop new features, docs ...
* **bug** - checkout from master and pull.req. OR checkout from release branch and pull.req/Master
* **features** -  checkout Develop.

Branch naming conventions
#########################

shall follow that of [GroupName/Info](http://stackoverflow.com/questions/273695/git-branch-naming-best-practices):

1. Use **grouping names** at the beginning of your branch names.
2. Define and use short **lead tokens** to differentiate branches in a way that is meaningful to your workflow.
3. Use slashes to separate parts of your branch names.
4. Do not use bare numbers as leading parts.
5. Avoid long descriptive names for long-lived branches.

Grouping Names
##############

Short and well-defined group names (used to tell you to which part of your workflow each branch belongs):
`code-block/ text`

- **rc** release candidate
- **new** major new feature, module
- **feat** addition of incremental feature/enhancement
- **bug** Bug fix
- **junk** Throwaway branch created to experiment
- **test**
- **doc** documentation (readme, code comment)

Commit messages
###############

Standard prefixes to start a commit message: `code-block:: text`

-   **BLD** change related to build
-   **BUG** bug fix
-   **DEP** deprecate something, or remove a deprecated object
-   **DEV** development tool or utility
-   **DOC** documentation
-   **ENH** enhancement
-   **MAINT** maintenance commit (refactoring, typos, etc)
-   **REV** revert an earlier commit
-   **STY** style fix (whitespace, PEP8, flake8, etc)
-   **TST** addition or modification of tests
-   **REL** related to releasing
-   **PERF** performance enhancements


Some commit style guidelines:

Commit lines should be no longer than `72 characters`__. The first line of the commit should include one of the above prefixes. There should be an empty line between the commit subject and the body of the commit. In general, the message should be in the imperative tense. Best practice is to include not only what the change is, but why the change was made.

__ https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project


Repo Structure
##############

git remote add bt2-original https://github.com/backtrader2/backtrader.git
git fetch bt2-original master
git branch –set-upstream-to=bt2-original/master
git pull
git push origin -u bt2/original/master

git remote -v


    bt-original     https://github.com/mementum/backtrader.git (fetch)
    bt-original     https://github.com/mementum/backtrader.git (push)
    bt2-original    https://github.com/backtrader2/backtrader.git (fetch)
    bt2-original    https://github.com/backtrader2/backtrader.git (push)
    mementum        https://github.com/mementum/backtrader.git (fetch)
    mementum        https://github.com/mementum/backtrader.git (push)
    origin  git@gitlab.com:algorithmic-trading-library/backtrader.git (fetch)
    origin  git@gitlab.com:algorithmic-trading-library/backtrader.git (push)


git branch -vv

      bt/original/develop  fca15d9 [origin/bt/original/develop] Release 1.9.75.123
      bt/original/master   0fa63ef [origin/bt/original/master] Merge pull request #418 from Larry-u/patch-1
      bt2/original/develop ef00a78 [origin/bt2/original/develop] Merge branch 'master' of https://github.com/backtrader2/backtrader into bt2/original/master
      bt2/original/master  ef00a78 [origin/bt2/original/master] Merge branch 'master' of https://github.com/backtrader2/backtrader into bt2/original/master
      develop              9f843b0 MAINT: making things cleaner for testing bid/ask.
      development          9f843b0 [origin/development: gone] MAINT: making things cleaner for testing bid/ask.
      feat/ib/bidask       dcb4c1a Release 1.9.74.123
      feat/ib/rt-bidask    7b366cd [origin/feat/ib/rt-bidask] FEAT: bid/ask stream. on and off. tested live.
      master               9f843b0 [origin/master] MAINT: making things cleaner for testing bid/ask.

Fetching all remote branches
############################

    for abranch in $(git branch -a | grep -v HEAD | grep remotes | sed "s/remotes\/origin\///g"); do git checkout $abranch ; done



            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/algorithmic-trading-library/backtrader",
    "name": "backtrader-lucidinvestor",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "trading,development",
    "author": "maintainer: LucidInvestor",
    "author_email": "info@lucidinvestor.ca",
    "download_url": "https://files.pythonhosted.org/packages/84/5c/00dca7f0973cdd5520fe66a999008832c44a2509f279a65ac709bbfb6b9f/backtrader-lucidinvestor-1.9.7701.tar.gz",
    "platform": null,
    "description": "backtrader\n**********\n\ncredits\n#######\n\noriginal author: Daniel Rodriguez (danjrod@gmail.com)\noriginal unmaintained github: https://github.com/mementum/backtrader\nalternative unmaintained github: https://github.com/backtrader2/backtrader\n\nTickets\n#######\n\nThe ticket system is available at `LucidInvestor's public gitlab instance <https://gitlab.com/algorithmic-trading-library/backtrader/-/issues>`_.\n\nHere a snippet of a Simple Moving Average CrossOver. It can be done in several\ndifferent ways. Use the docs (and examples) Luke!\n::\n\n  from datetime import datetime\n  import backtrader as bt\n\n  class SmaCross(bt.SignalStrategy):\n      def __init__(self):\n          sma1, sma2 = bt.ind.SMA(period=10), bt.ind.SMA(period=30)\n          crossover = bt.ind.CrossOver(sma1, sma2)\n          self.signal_add(bt.SIGNAL_LONG, crossover)\n\n  cerebro = bt.Cerebro()\n  cerebro.addstrategy(SmaCross)\n\n  data0 = bt.feeds.YahooFinanceData(dataname='MSFT', fromdate=datetime(2011, 1, 1),\n                                    todate=datetime(2012, 12, 31))\n  cerebro.adddata(data0)\n\n  cerebro.run()\n  cerebro.plot()\n\nIncluding a full featured chart. Give it a try! This is included in the samples\nas ``sigsmacross/sigsmacross2.py``. Along it is ``sigsmacross.py`` which can be\nparametrized from the command line.\n\nInstallation\n############\n\n``backtrader`` is self-contained with no external dependencies (except if you\nwant to plot)\n\nFrom *pypi*:\n\n  - ``pip install backtrader-lucidinvestor``\n\n  - ``pip install backtrader[plotting]``\n\n    If ``matplotlib`` is not installed and you wish to do some plotting\n\n.. note:: The minimum matplotlib version is ``1.4.1``\n\nAn example for *IB* Data Feeds/Trading:\n\n  - ``IbPy`` ``pip install IbPy-lucidinvestor``\n\nFor other functionalities like: ``Visual Chart``, ``Oanda``, ``TA-Lib``, check\nthe dependencies in the documentation.\n\nFrom source:\n\n  - Place the *backtrader* directory found in the sources inside your project\n\nPython 2/3 Support\n##################\n\n  - Python >= ``3.2``\n\n  - It also works with ``pypy`` and ``pypy3`` (no plotting - ``matplotlib`` is\n    not supported under *pypy*)\n\nFeatures\n********\n\nLive Trading and backtesting platform written in Python.\n\n  - Live Data Feed and Trading with\n\n    - Interactive Brokers (needs ``IbPy`` and benefits greatly from an\n      installed ``pytz``)\n    - *Visual Chart* (needs a fork of ``comtypes`` until a pull request is\n      integrated in the release and benefits from ``pytz``)\n    - *Oanda* (needs ``oandapy``) (REST API Only - v20 did not support\n      streaming when implemented)\n\n  - Data feeds from csv/files, online sources or from *pandas* and *blaze*\n  - Filters for datas, like breaking a daily bar into chunks to simulate\n    intraday or working with Renko bricks\n  - Multiple data feeds and multiple strategies supported\n  - Multiple timeframes at once\n  - Integrated Resampling and Replaying\n  - Step by Step backtesting or at once (except in the evaluation of the Strategy)\n  - Integrated battery of indicators\n  - *TA-Lib* indicator support (needs python *ta-lib* / check the docs)\n  - Easy development of custom indicators\n  - Analyzers (for example: TimeReturn, Sharpe Ratio, SQN) and ``pyfolio``\n    integration (**deprecated**)\n  - Flexible definition of commission schemes\n  - Integrated broker simulation with *Market*, *Close*, *Limit*, *Stop*,\n    *StopLimit*, *StopTrail*, *StopTrailLimit*and *OCO* orders, bracket order,\n    slippage, volume filling strategies and continuous cash adjustmet for\n    future-like instruments\n  - Sizers for automated staking\n  - Cheat-on-Close and Cheat-on-Open modes\n  - Schedulers\n  - Trading Calendars\n  - Plotting (requires matplotlib)\n\nDocumentation\n*************\n\nThe blog:\n\n  - `Blog <http://www.backtrader.com/blog>`_\n\nRead the full documentation at:\n\n  - `Documentation <http://www.backtrader.com/docu>`_\n\nList of built-in Indicators (122)\n\n  - `Indicators Reference <http://www.backtrader.com/docu/indautoref.html>`_\n\nVersion numbering\n*****************\n\nX.Y.Z.I\n\n  - X: Major version number. Should stay stable unless something big is changed\n    like an overhaul to use ``numpy``\n  - Y: Minor version number. To be changed upon adding a complete new feature or\n    (god forbids) an incompatible API change.\n  - Z: Revision version number. To be changed for documentation updates, small\n    changes, small bug fixes\n  - I: Number of Indicators already built into the platform\n\nmajor Branches\n##############\n\n* **master**  - Merge from Develop. QA for full integration happens here.\n  Contains the last tested/verified global code integration.\n* **release** - Checkout from Master. Branch based on release & tags. Bug fix in checkout branches,\n  and merge with others.\n* **develop** - Checkout from Master / Pull.Req from Develop. Develop new features, docs ...\n* **bug** - checkout from master and pull.req. OR checkout from release branch and pull.req/Master\n* **features** -  checkout Develop.\n\nBranch naming conventions\n#########################\n\nshall follow that of [GroupName/Info](http://stackoverflow.com/questions/273695/git-branch-naming-best-practices):\n\n1. Use **grouping names** at the beginning of your branch names.\n2. Define and use short **lead tokens** to differentiate branches in a way that is meaningful to your workflow.\n3. Use slashes to separate parts of your branch names.\n4. Do not use bare numbers as leading parts.\n5. Avoid long descriptive names for long-lived branches.\n\nGrouping Names\n##############\n\nShort and well-defined group names (used to tell you to which part of your workflow each branch belongs):\n`code-block/ text`\n\n- **rc** release candidate\n- **new** major new feature, module\n- **feat** addition of incremental feature/enhancement\n- **bug** Bug fix\n- **junk** Throwaway branch created to experiment\n- **test**\n- **doc** documentation (readme, code comment)\n\nCommit messages\n###############\n\nStandard prefixes to start a commit message: `code-block:: text`\n\n-   **BLD** change related to build\n-   **BUG** bug fix\n-   **DEP** deprecate something, or remove a deprecated object\n-   **DEV** development tool or utility\n-   **DOC** documentation\n-   **ENH** enhancement\n-   **MAINT** maintenance commit (refactoring, typos, etc)\n-   **REV** revert an earlier commit\n-   **STY** style fix (whitespace, PEP8, flake8, etc)\n-   **TST** addition or modification of tests\n-   **REL** related to releasing\n-   **PERF** performance enhancements\n\n\nSome commit style guidelines:\n\nCommit lines should be no longer than `72 characters`__. The first line of the commit should include one of the above prefixes. There should be an empty line between the commit subject and the body of the commit. In general, the message should be in the imperative tense. Best practice is to include not only what the change is, but why the change was made.\n\n__ https://git-scm.com/book/en/v2/Distributed-Git-Contributing-to-a-Project\n\n\nRepo Structure\n##############\n\ngit remote add bt2-original https://github.com/backtrader2/backtrader.git\ngit fetch bt2-original master\ngit branch \u2013set-upstream-to=bt2-original/master\ngit pull\ngit push origin -u bt2/original/master\n\ngit remote -v\n\n\n    bt-original     https://github.com/mementum/backtrader.git (fetch)\n    bt-original     https://github.com/mementum/backtrader.git (push)\n    bt2-original    https://github.com/backtrader2/backtrader.git (fetch)\n    bt2-original    https://github.com/backtrader2/backtrader.git (push)\n    mementum        https://github.com/mementum/backtrader.git (fetch)\n    mementum        https://github.com/mementum/backtrader.git (push)\n    origin  git@gitlab.com:algorithmic-trading-library/backtrader.git (fetch)\n    origin  git@gitlab.com:algorithmic-trading-library/backtrader.git (push)\n\n\ngit branch -vv\n\n      bt/original/develop  fca15d9 [origin/bt/original/develop] Release 1.9.75.123\n      bt/original/master   0fa63ef [origin/bt/original/master] Merge pull request #418 from Larry-u/patch-1\n      bt2/original/develop ef00a78 [origin/bt2/original/develop] Merge branch 'master' of https://github.com/backtrader2/backtrader into bt2/original/master\n      bt2/original/master  ef00a78 [origin/bt2/original/master] Merge branch 'master' of https://github.com/backtrader2/backtrader into bt2/original/master\n      develop              9f843b0 MAINT: making things cleaner for testing bid/ask.\n      development          9f843b0 [origin/development: gone] MAINT: making things cleaner for testing bid/ask.\n      feat/ib/bidask       dcb4c1a Release 1.9.74.123\n      feat/ib/rt-bidask    7b366cd [origin/feat/ib/rt-bidask] FEAT: bid/ask stream. on and off. tested live.\n      master               9f843b0 [origin/master] MAINT: making things cleaner for testing bid/ask.\n\nFetching all remote branches\n############################\n\n    for abranch in $(git branch -a | grep -v HEAD | grep remotes | sed \"s/remotes\\/origin\\///g\"); do git checkout $abranch ; done\n\n\n",
    "bugtrack_url": null,
    "license": "GPLv3+",
    "summary": "BackTesting Engine - maintained by LucidInvestor",
    "version": "1.9.7701",
    "split_keywords": [
        "trading",
        "development"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "015ba80b82fb6721a3935fefc6ffa9819540547fcc915a2d5f5e4252b1317e08",
                "md5": "9fbf9f2e4ac55a6614f63ca62b38e87a",
                "sha256": "912931b5cd6b701d59c01f0e3b91e6de91b0c39bfec6500cbb7eaa677a19fa46"
            },
            "downloads": -1,
            "filename": "backtrader_lucidinvestor-1.9.7701-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9fbf9f2e4ac55a6614f63ca62b38e87a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 425182,
            "upload_time": "2023-01-23T17:23:08",
            "upload_time_iso_8601": "2023-01-23T17:23:08.462522Z",
            "url": "https://files.pythonhosted.org/packages/01/5b/a80b82fb6721a3935fefc6ffa9819540547fcc915a2d5f5e4252b1317e08/backtrader_lucidinvestor-1.9.7701-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "845c00dca7f0973cdd5520fe66a999008832c44a2509f279a65ac709bbfb6b9f",
                "md5": "170ac95ce8a5e4412d9603bc60331b6d",
                "sha256": "1a954bc9478f8fd5a8444620d7f273ab2bdd4df220c43c1661ce55a54dd1155d"
            },
            "downloads": -1,
            "filename": "backtrader-lucidinvestor-1.9.7701.tar.gz",
            "has_sig": false,
            "md5_digest": "170ac95ce8a5e4412d9603bc60331b6d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 2164121,
            "upload_time": "2023-01-23T17:23:12",
            "upload_time_iso_8601": "2023-01-23T17:23:12.205133Z",
            "url": "https://files.pythonhosted.org/packages/84/5c/00dca7f0973cdd5520fe66a999008832c44a2509f279a65ac709bbfb6b9f/backtrader-lucidinvestor-1.9.7701.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-01-23 17:23:12",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "gitlab_user": "algorithmic-trading-library",
    "gitlab_project": "backtrader",
    "lcname": "backtrader-lucidinvestor"
}
        
Elapsed time: 0.06459s