Hi, I am trying to apply lambda function by assigning 1 when df['Adj Close']> df['x candle high'] but it showed error. Anyone know what is the problem please?
df['signal']= df.apply(lambda x : x==1 if x['Adj Close']> x['x candle high'] else 0, axis=1)
TypeError: 'str' object is not callable
Please see attachment if you need.
Thanks in advance