First thing I need to mention is the file you provided which is named "QQE Indicator.txt" includes a the MACD Histogram. Based on a quick search of the internet I do not find that the MACD histogram should be included. So I just want the rest of our viewers to know that in case they attempt to use the version you provided with your question.
The solution I have provided below includes only the QQE sections of the code. And I have cleaned up the code to make it easier to present in this forum.
Oh, and there are two plots on this QQE indicator and you did not mention which of the two should be used for the crossing event. So I have chosen to use the plot named "pRsiMa" for this solution. Why? Because that seems to be the main metric used in this indicator and it makes for a much simpler section of code.
declare lower;
input rsiLength = 21;
input slowFactor = 8;
def rsi = RSI(price = vwap, length = rsiLength).RSI;
def pRsiMa = MovingAverage(AverageType.EXPONENTIAL, rsi, slowFactor);
def crossAbove = pRsiMa[1] < 50 and pRsiMa > 50;
def crossBelow = pRsiMa[1] > 50 and pRsiMa < 50;
plot data = if crossAbove then 1 else if crossBelow then -1 else 0;
data.AssignValueColor(if data <> 0 then Color.BLACK else Color.CURRENT);
AssignBackgroundColor(if data == 1 then Color.GREEN else if data == -1 then Color.RED else Color.CURRENT);