10 lines
359 B
Python
10 lines
359 B
Python
from pandas import DataFrame, Series
|
|
|
|
def signals(data: DataFrame) -> Series:
|
|
"""
|
|
Calculate the Internal Bar Strength (IBS) signal.
|
|
Returns a Series with 'L' for long signals and 'N' otherwise.
|
|
"""
|
|
ibs_series = (data['Close'] - data['Low']) / (data['High'] - data['Low'])
|
|
return ibs_series.apply(lambda ibs: 'L' if ibs < 0.2 else 'N')
|