diff --git a/strategies/large_moves_down.py b/strategies/large_moves_down.py new file mode 100644 index 0000000..b378a58 --- /dev/null +++ b/strategies/large_moves_down.py @@ -0,0 +1,10 @@ +from pandas import DataFrame, Series + +def signals(data: DataFrame) -> Series: + """ + Generate swing trading signals based the Large Moves (Down) strategy. + + Returns a Series with 'L' for long signals and 'N' otherwise. + """ + percent_change = (data['Open'] - data['Close']) / data['Open'] + return percent_change.apply(lambda change: 'L' if change >= 0.01 else 'N') \ No newline at end of file