8 lines
336 B
Python
8 lines
336 B
Python
from pandas import DataFrame, Series
|
|
|
|
def signals(data: DataFrame) -> Series:
|
|
"""
|
|
Calculate the End of Month (EOM) signal.
|
|
Returns a Series with 'L' for long signals if the date is close to the end of the month and 'N' otherwise.
|
|
"""
|
|
return data['Date'].apply(lambda x: 'L' if x.day in [23, 24, 25, 26, 27] else 'N') |