Skip to content

Commit a0c2510

Browse files
Formulate global variables in the singular form if they receive a single input.
1 parent 11dd2e5 commit a0c2510

File tree

5 files changed

+17
-21
lines changed

5 files changed

+17
-21
lines changed

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ First, the data source is specified in more detail in the configuration file:
3535

3636
```python
3737
STOCKS = ["AAPL", "MSFT"]
38-
START_DATES = "2019-01-01"
39-
END_DATES = "2025-01-01"
40-
INTERVALS = "1d"
38+
START_DATE = "2019-01-01"
39+
END_DATE = "2025-01-01"
40+
INTERVAL = "1d"
4141
```
4242

4343
Multiple valid symbols from [yfinance](https://pypi.org/project/yfinance/) can be added
44-
to the `STOCKS` list. `START_DATES` and `END_DATES` define the time range for the price
44+
to the `STOCKS` list. `START_DATE` and `END_DATE` define the time range for the price
4545
history of the selected `STOCKS` at a specified `INTERVAL`. The available options for
4646
`INTERVAL` are listed at the end of the README file.
4747

src/backtest_bay/backtest/task_backtest.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
from backtest_bay.backtest.generate_signals import generate_signals
1313
from backtest_bay.config import (
1414
BLD,
15-
END_DATES,
15+
END_DATE,
1616
INITIAL_CASH,
17-
INTERVALS,
17+
INTERVAL,
1818
SRC,
19-
START_DATES,
19+
START_DATE,
2020
STOCKS,
2121
STRATEGIES,
2222
TAC,
@@ -30,9 +30,7 @@
3030
]
3131

3232
params_to_backtest = pd.DataFrame(
33-
list(
34-
itertools.product(STOCKS, [START_DATES], [END_DATES], [INTERVALS], STRATEGIES)
35-
),
33+
list(itertools.product(STOCKS, [START_DATE], [END_DATE], [INTERVAL], STRATEGIES)),
3634
columns=["stock", "start_date", "end_date", "interval", "strategy"],
3735
)
3836

src/backtest_bay/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
# Data source
1111
STOCKS = ["AAPL", "MSFT"]
12-
START_DATES = "2019-01-01"
13-
END_DATES = "2025-01-01"
14-
INTERVALS = "1d"
12+
START_DATE = "2019-01-01"
13+
END_DATE = "2025-01-01"
14+
INTERVAL = "1d"
1515

1616
# Trading strategies
1717
STRATEGIES = ["bollinger", "macd", "roc", "rsi"]

src/backtest_bay/data/task_download_data.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@
55
import pandas as pd
66
import pytask
77

8-
from backtest_bay.config import BLD, END_DATES, INTERVALS, SRC, START_DATES, STOCKS
8+
from backtest_bay.config import BLD, END_DATE, INTERVAL, SRC, START_DATE, STOCKS
99
from backtest_bay.data.download_data import download_data
1010

1111
scripts = [SRC / "config.py", SRC / "data" / "download_data.py"]
1212

1313
data_to_download = pd.DataFrame(
14-
list(itertools.product(STOCKS, [START_DATES], [END_DATES], [INTERVALS])),
14+
list(itertools.product(STOCKS, [START_DATE], [END_DATE], [INTERVAL])),
1515
columns=["stock", "start_date", "end_date", "interval"],
1616
)
1717

src/backtest_bay/plot/task_plot.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@
77

88
from backtest_bay.config import (
99
BLD,
10-
END_DATES,
10+
END_DATE,
1111
INITIAL_CASH,
12-
INTERVALS,
12+
INTERVAL,
1313
SRC,
14-
START_DATES,
14+
START_DATE,
1515
STOCKS,
1616
STRATEGIES,
1717
TAC,
@@ -26,9 +26,7 @@
2626
]
2727

2828
params_to_plot = pd.DataFrame(
29-
list(
30-
itertools.product(STOCKS, [START_DATES], [END_DATES], [INTERVALS], STRATEGIES)
31-
),
29+
list(itertools.product(STOCKS, [START_DATE], [END_DATE], [INTERVAL], STRATEGIES)),
3230
columns=["stock", "start_date", "end_date", "interval", "strategy"],
3331
)
3432

0 commit comments

Comments
 (0)