|
1 | | -# BacktestBay: Evaluation of Trading Strategies |
| 1 | +# BacktestBay |
2 | 2 |
|
3 | 3 | BacktestBay is a Python-based framework for backtesting trading strategies. It leverages |
4 | 4 | [yfinance](https://pypi.org/project/yfinance/) for importing financial data. |
5 | 5 |
|
| 6 | +## Getting Started |
| 7 | + |
| 8 | +To get started, first clone the repository using the following command: |
| 9 | + |
| 10 | +```bash |
| 11 | +git clone repository-url |
| 12 | +``` |
| 13 | + |
| 14 | +Next, create and activate the environment by navigating to the directory containing |
| 15 | +`environment.yml` and running: |
| 16 | + |
| 17 | +```bash |
| 18 | +mamba env create -f environment.yml |
| 19 | +mamba activate backtest_bay |
| 20 | +``` |
| 21 | + |
| 22 | +Once the environment is set up, initialize the project by typing the following in the |
| 23 | +project directory: |
| 24 | + |
| 25 | +```bash |
| 26 | +pytask |
| 27 | +``` |
| 28 | + |
6 | 29 | ## Configuration |
7 | 30 |
|
8 | 31 | BacktestBay enables the configuration of input parameters through |
@@ -48,31 +71,24 @@ TRADE_PCT = 0.05 |
48 | 71 |
|
49 | 72 | providing users with greater control and flexibility in their backtesting process. |
50 | 73 | `INITIAL_CASH` specifies the amount of cash available at the start. `TAC` specifies the |
51 | | -transaction costs as a percentage of the traded volume.. `TRADE_PCT` indicates the |
| 74 | +transaction costs as a percentage of the traded volume. `TRADE_PCT` indicates the |
52 | 75 | percentage of the current portfolio allocated for trading. |
53 | 76 |
|
54 | | -## Getting Started |
55 | | - |
56 | | -To get started, first clone the repository using the following command: |
57 | | - |
58 | | -```bash |
59 | | -git clone repository-url |
60 | | -``` |
| 77 | +The initialization of the project with `pytask` creates a `bld/plot` folder in the |
| 78 | +repository, where two analyses are generated for each stock in `STOCKS`: |
61 | 79 |
|
62 | | -Next, create and activate the environment by navigating to the directory containing |
63 | | -`environment.yml` and running: |
| 80 | +- **`portfolio`**: Shows the development of the portfolio over time, including |
| 81 | + performance metrics. |
| 82 | +- **`signals`**: Provides a detailed analysis of the signals in relation to the price |
| 83 | + trend. |
64 | 84 |
|
65 | | -```bash |
66 | | -mamba env create -f environment.yml |
67 | | -mamba activate backtest_bay |
68 | | -``` |
| 85 | +## Project Structure |
69 | 86 |
|
70 | | -Once the environment is set up, initialize the project by typing the following in the |
71 | | -project directory: |
| 87 | +The project structure in `src/backtest_bay` is as follows: |
72 | 88 |
|
73 | | -```bash |
74 | | -pytask |
75 | | -``` |
| 89 | +- **`download_data`**: Contains functions to download `STOCKS`. |
| 90 | +- **`backtest`**: Develops functions to generate trading signals and backtest them. |
| 91 | +- **`plot`**: Plots portfolio performance. |
76 | 92 |
|
77 | 93 | ## yfinance Download Intervals and Maximum History |
78 | 94 |
|
|
0 commit comments