Add script for generating end of month swing trading signals
This commit is contained in:
parent
63e911323c
commit
c2b2d00beb
8
strategies/end_of_month.py
Normal file
8
strategies/end_of_month.py
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
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 [24, 25, 26] else 'N')
|
Loading…
Reference in New Issue
Block a user