diff --git a/strategies/short_term_lows.py b/strategies/short_term_lows.py new file mode 100644 index 0000000..cad0b6f --- /dev/null +++ b/strategies/short_term_lows.py @@ -0,0 +1,10 @@ +from pandas import DataFrame, Series + +def signals(data: DataFrame) -> Series: + """ + Generate signals for entering a long trade when the market makes a 10-day low. + + Returns a series with 'L' for long signals and 'N' otherwise. + """ + ten_day_low = data['Low'] == data['Low'].rolling(window = 10, min_periods = 10).min() + return ten_day_low.apply(lambda x: 'L' if x else 'N') \ No newline at end of file