Skip to content

Commit b1066f1

Browse files
committed
Add initial Backtesting.py (squashed dev branch)
0 parents  commit b1066f1

35 files changed

+14531
-0
lines changed

.codecov.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
coverage:
2+
range: 75..95
3+
precision: 0
4+
status:
5+
patch:
6+
default:
7+
target: '95'
8+
project:
9+
default:
10+
target: auto

.coveragerc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[run]
2+
parallel = 1
3+
concurrency =
4+
multiprocessing
5+
source =
6+
backtesting
7+
doc/examples
8+
omit =
9+
10+
[report]
11+
exclude_lines =
12+
return
13+
raise
14+
except
15+
warnings.warn

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
*.py[cod]
2+
*.html
3+
*.png
4+
_version.py
5+
6+
*.egg-info
7+
__pycache__/*
8+
dist/*
9+
10+
.coverage
11+
.coverage.*
12+
htmlcov/*
13+
14+
doc/build/*
15+
16+
.idea/*
17+
**/.ipynb_checkpoints
18+
*~*

.travis.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
language: python
2+
dist: trusty
3+
sudo: false
4+
cache:
5+
pip: true
6+
7+
matrix:
8+
fast_finish: true
9+
include:
10+
- python: '3.5'
11+
- python: '3.7'
12+
13+
- python: '3.6'
14+
name: 'Lint, Test w/ Coverage'
15+
before_script:
16+
- pip install flake8 coverage
17+
script:
18+
- flake8 --max-line-length=120 --exclude doc/examples .
19+
- BOKEH_BROWSER=none catchsegv coverage run setup.py test
20+
after_success:
21+
- bash <(curl -s https://codecov.io/bash)
22+
23+
- python: '3.6'
24+
name: 'Docs'
25+
stage: deploy
26+
install:
27+
- pip install .[doc]
28+
script:
29+
- doc/build.sh
30+
after_success:
31+
- if [ "$TRAVIS_BRANCH" = "$TRAVIS_TAG" ]; then bash doc/deploy.sh; fi
32+
33+
before_install:
34+
- set -eu
35+
36+
install:
37+
- pip install .
38+
39+
script:
40+
- time catchsegv python setup.py test

LICENSE.md

Lines changed: 660 additions & 0 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Backtesting.py
2+
==============
3+
Backtest trading strategies with Python.
4+
5+
[![Build Status](https://travis-ci.org/kernc/backtesting.py.svg?branch=master)](https://travis-ci.org/kernc/backtesting.py)
6+
[![Code Coverage](https://codecov.io/gh/kernc/backtesting.py/branch/master/graph/badge.svg)](https://codecov.io/gh/kernc/backtesting.py)
7+
[![Backtesting on PyPI](https://img.shields.io/pypi/pyversions/backtesting.svg)](https://pypi.org/project/backtesting/)
8+
9+
[**Project website**](https://kernc.github.io/backtesting.py/)
10+
11+
[Documentation](https://kernc.github.io/backtesting.py/doc/backtesting/)
12+
13+
Development
14+
-----------
15+
Fork the project. Then:
16+
17+
git clone [email protected]:YOUR_USERNAME/backtesting.py
18+
cd backtesting.py
19+
pip3 install -e .[doc]

backtesting/__init__.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
"""
2+
# Backtesting.py Documentation
3+
4+
## Manuals
5+
6+
* [Quick Start User Guide](../examples/Quick Start User Guide.html)
7+
8+
## Tutorials
9+
10+
* [Library of Utilities and Composable Base Strategies](../examples/Strategies Library.html)
11+
* [Multiple Time Frames](../examples/Multiple Time Frames.html)
12+
* [Parameter Heatmap](../examples/Parameter Heatmap.html)
13+
14+
You can also [try these out] live.
15+
16+
[try these out]: https://mybinder.org/v2/gh/kernc/backtesting.py/master?urlpath=lab%2Ftree%2Fdoc%2Fexamples
17+
18+
## Example Strategies
19+
20+
* (contributions welcome)
21+
22+
## License
23+
24+
This software is licensed under the terms of [AGPL 3.0],
25+
meaning you can use it for any reasonable purpose and remain in
26+
complete ownership of all the excellent trading strategies you produce,
27+
but you are also encouraged to make sure any upgrades to `backtesting`
28+
itself find their way back to the community.
29+
30+
[AGPL 3.0]: https://www.gnu.org/licenses/agpl-3.0.html
31+
32+
# API Reference Documentation
33+
"""
34+
try:
35+
from ._version import version as __version__ # noqa: F401
36+
except ImportError:
37+
pass # Package not installed
38+
39+
from .backtesting import Backtest, Strategy, Orders, Position # noqa: F401
40+
from . import lib # noqa: F401

0 commit comments

Comments
 (0)