Alice — an open-source AI trading bot covering equities, crypto, commodities, forex, and macro
| 1 | """Base strategy protocol.""" |
| 2 | |
| 3 | from __future__ import annotations |
| 4 | |
| 5 | from typing import Protocol |
| 6 | |
| 7 | import pandas as pd |
| 8 | |
| 9 | |
| 10 | class Strategy(Protocol): |
| 11 | """Protocol that all trading strategies must implement.""" |
| 12 | |
| 13 | def generate_signals(self, df: pd.DataFrame) -> pd.DataFrame: |
| 14 | """Generate trading signals from OHLCV data.""" |
| 15 | ... |