I try to put 1 por trading strategy when rsi if > 30 and 0 if the previous period if < 30
data['rsi_compra'] = 1 if data.rsi > 30 & data.rsi.shift(periods = 1) < 30 else 0
Raise this error
Cannot perform 'rand_' with a dtyped [float64] array and scalar of type [bool]