// Buy and Sell Conditions buyCondition = ta.crossover(shortMA, longMA) and rsi < rsi_oversold and (macdLine > signalLine) and (close <= lowerBand) and (k < 20 and ta.crossover(k, d)) sellCondition = ta.crossunder(shortMA, longMA) and rsi > rsi_overbought and (macdLine < signalLine) and (close >= upperBand) and (k > 80 and ta.crossunder(k, d))