Skip to content

Commit a35e472

Browse files
First draft of a more detailed project description.
1 parent 22d653f commit a35e472

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

README.md

Lines changed: 66 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,66 @@
1-
# Evaluation of Trading Strategies
1+
# BacktestBay: Evaluation of Trading Strategies
2+
3+
BacktestBay is a Python-based framework for backtesting trading strategies. It leverages
4+
`yfinance` for importing financial data.
5+
6+
## Configuration
7+
8+
BacktestBay enables the configuration of input parameters through
9+
[config.py](https://github.com/iame-uni-bonn/final-project-niklasniedermeier-1/blob/main/src/backtest_bay/config.py).
10+
11+
This configuration file allows for the customization of data source settings
12+
13+
```python
14+
STOCKS = ["AAPL", "MSFT"] # List of stock symbols from yfinance
15+
START_DATES = ["2019-01-01"] # Start date for historical data ("YYYY-MM_DD")
16+
END_DATES = ["2025-01-01"] # End date for historical data ("YYYY-MM_DD")
17+
INTERVALS = ["1d"] # Data frequency (e.g., daily)
18+
```
19+
20+
and the choice of trading strategies
21+
22+
```python
23+
STRATEGIES = ["bollinger", "macd", "roc", "rsi"]
24+
```
25+
26+
as well as the adjustment of trading parameters
27+
28+
```python
29+
INITIAL_CASH = 1000000 # Initial capital for trading
30+
TAC = 0.005 # Transaction cost
31+
TRADE_PCT = 0.05 # Percentage of current portfolio used per trade
32+
```
33+
34+
providing users with enhanced control and flexibility in their backtesting process.
35+
36+
The following trading strategies are currently implemented
37+
38+
- 'bollinger':
39+
[Bollinger Bands](https://www.investopedia.com/terms/b/bollingerbands.asp)
40+
- 'macd':
41+
[Moving Average Convergence Divergence](https://www.investopedia.com/terms/m/macd.asp)
42+
- 'roc': [Rate of Change](https://www.investopedia.com/terms/p/pricerateofchange.asp)
43+
- 'rsi': [Relative Strength Index](https://www.investopedia.com/terms/r/rsi.asp)
44+
45+
## Getting Started
46+
47+
To get started, first clone the repository using the following command:
48+
49+
```bash
50+
git clone <repository-url>
51+
```
52+
53+
Next, create and activate the environment by navigating to the directory containing
54+
`environment.yml` and running:
55+
56+
```bash
57+
mamba env create -f environment.yml
58+
mamba activate backtest_bay
59+
```
60+
61+
Once the environment is set up, initialize the project by typing the following in the
62+
project directory:
63+
64+
```bash
65+
pytask
66+
```

src/backtest_bay/config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,16 @@
1010

1111
BLD = ROOT.joinpath("bld").resolve()
1212

13-
# Configure input data
13+
# Data source
1414
STOCKS = ["AAPL", "MSFT"]
1515
START_DATES = ["2019-01-01"]
1616
END_DATES = ["2025-01-01"]
1717
INTERVALS = ["1d"]
18+
19+
# Trading strategies
1820
STRATEGIES = ["bollinger", "macd", "roc", "rsi"]
1921

22+
# Trading parameters
2023
INITIAL_CASH = 1000000
2124
TAC = 0.005
2225
TRADE_PCT = 0.05

0 commit comments

Comments
 (0)