diff --git a/strategies/lower_lows.py b/strategies/lower_lows.py new file mode 100644 index 0000000..75ff5cd --- /dev/null +++ b/strategies/lower_lows.py @@ -0,0 +1,11 @@ +from pandas import DataFrame, Series + +def signals(data: DataFrame) -> Series: + """ + Generate signals for entering a long trade when the market makes + a lower low for 2 consecutive days. + + Returns a Series with 'L' for long signals and 'N' otherwise. + """ + lower_low = data['Low'].shift(1) > data['Low'] + return (lower_low & lower_low.shift(1)).apply(lambda x: 'L' if x else 'N') \ No newline at end of file