Below is the pine script that needs to be converted to Motivewave Java.
//@version=5
indicator("QQE Advanced",overlay=true)
//
RSI_Period = input(5, title='RSI Length')
SF = input(3, title='RSI Smoothing')
QQE = input(3.39, title='Fast QQE Factor')
ThreshHold = input(3, title='Thresh-hold')
//
sQQEx = input(false, title='Show Smooth RSI, QQE Signal crosses')
sQQEz = input(false, title='Show Smooth RSI Zero crosses')
sQQEc = input(false, title='Show Smooth RSI Thresh Hold Channel Exits')
ma_type = [login to view URL](title='MA Type', defval='EMA', options=['ALMA', 'EMA', 'DEMA', 'TEMA', 'WMA', 'VWMA', 'SMA', 'SMMA', 'HMA', 'LSMA', 'PEMA'])
lsma_offset = [login to view URL](defval=0, title='* Least Squares (LSMA) Only - Offset Value', minval=0)
alma_offset = [login to view URL](defval=0.85, title='* Arnaud Legoux (ALMA) Only - Offset Value', minval=0, step=0.01)
alma_sigma = [login to view URL](defval=6, title='* Arnaud Legoux (ALMA) Only - Sigma Value', minval=0)
inpDrawBars = input(true, title='color bars?')
ma(type, src, len) =>
float result = 0
if type == 'SMA' // Simple
result := [login to view URL](src, len)
result
if type == 'EMA' // Exponential
result := [login to view URL](src, len)
result
if type == 'DEMA' // Double Exponential
e = [login to view URL](src, len)
result := 2 * e - [login to view URL](e, len)
result
if type == 'TEMA' // Triple Exponential
e = [login to view URL](src, len)
result := 3 * (e - [login to view URL](e, len)) + [login to view URL]([login to view URL](e, len), len)
result
if type == 'WMA' // Weighted
result := [login to view URL](src, len)
result
if type == 'VWMA' // Volume Weighted
result := [login to view URL](src, len)
result
if type == 'SMMA' // Smoothed
w = [login to view URL](src, len)
result := na(w[1]) ? [login to view URL](src, len) : (w[1] * (len - 1) + src) / len
result
if type == 'HMA' // Hull
result := [login to view URL](2 * [login to view URL](src, len / 2) - [login to view URL](src, len), [login to view URL]([login to view URL](len)))
result
if type == 'LSMA' // Least Squares
result := [login to view URL](src, len, lsma_offset)
result
if type == 'ALMA' // Arnaud Legoux
result := [login to view URL](src, len, alma_offset, alma_sigma)
result
if type == 'PEMA'
// Copyright (c) 2010-present, Bruno Pio
// Copyright (c) 2019-present, Alex Orekhov (everget)
// Pentuple Exponential Moving Average script may be freely distributed under the MIT license.
ema1 = [login to view URL](src, len)
ema2 = [login to view URL](ema1, len)
ema3 = [login to view URL](ema2, len)
ema4 = [login to view URL](ema3, len)
ema5 = [login to view URL](ema4, len)
ema6 = [login to view URL](ema5, len)
ema7 = [login to view URL](ema6, len)
ema8 = [login to view URL](ema7, len)
pema = 8 * ema1 - 28 * ema2 + 56 * ema3 - 70 * ema4 + 56 * ema5 - 28 * ema6 + 8 * ema7 - ema8
result := pema
result
result
src = input(close, title='RSI Source')
//
//
Wilders_Period = RSI_Period * 2 - 1
Rsi = [login to view URL](src, RSI_Period)
RsiMa = ma(ma_type, Rsi, SF)
AtrRsi = [login to view URL](RsiMa[1] - RsiMa)
MaAtrRsi = ma(ma_type, AtrRsi, Wilders_Period)
dar = ma(ma_type, MaAtrRsi, Wilders_Period) * QQE
longband = 0.0
shortband = 0.0
trendx = 0
DeltaFastAtrRsi = dar
RSIndex = RsiMa
newshortband = RSIndex + DeltaFastAtrRsi
newlongband = RSIndex - DeltaFastAtrRsi
longband := RSIndex[1] > longband[1] and RSIndex > longband[1] ? [login to view URL](longband[1], newlongband) : newlongband
shortband := RSIndex[1] < shortband[1] and RSIndex < shortband[1] ? [login to view URL](shortband[1], newshortband) : newshortband
cross_1 = [login to view URL](longband[1], RSIndex)
trendx := [login to view URL](RSIndex, shortband[1]) ? 1 : cross_1 ? -1 : nz(trendx[1], 1)
FastAtrRsiTL = trendx == 1 ? longband : shortband
//
// Find all the QQE Crosses
QQExlong = 0
QQExlong := nz(QQExlong[1])
QQExshort = 0
QQExshort := nz(QQExshort[1])
QQExlong := FastAtrRsiTL < RSIndex ? QQExlong + 1 : 0
QQExshort := FastAtrRsiTL > RSIndex ? QQExshort + 1 : 0
// Zero cross
QQEzlong = 0
QQEzlong := nz(QQEzlong[1])
QQEzshort = 0
QQEzshort := nz(QQEzshort[1])
QQEzlong := sQQEz and RSIndex >= 50 ? QQEzlong + 1 : 0
QQEzshort := sQQEz and RSIndex < 50 ? QQEzshort + 1 : 0
//
// Thresh Hold channel Crosses give the BUY/SELL alerts.
QQEclong = 0
QQEclong := nz(QQEclong[1])
QQEcshort = 0
QQEcshort := nz(QQEcshort[1])
QQEclong := sQQEc and RSIndex > 50 + ThreshHold ? QQEclong + 1 : 0
QQEcshort := sQQEc and RSIndex < 50 - ThreshHold ? QQEcshort + 1 : 0
hcolor = RsiMa - 50 > ThreshHold ? [login to view URL] : RsiMa - 50 < 0 - ThreshHold ? [login to view URL] : [login to view URL]
//EOF
bgc = RsiMa - 50 > ThreshHold ? [login to view URL](7, 196, 243) : Rsi - 50 < 0 - ThreshHold ? [login to view URL](247, 4, 117) : [login to view URL]
barcolor(inpDrawBars ? bgc : na)
rsima=[login to view URL](50,'RSI 100 level' )
orsi=[login to view URL](close,RSI_Period)
adjrsi=close+[login to view URL](100)*orsi/100
//rma=[login to view URL](adjrsi,rsima)
rsimatype=[login to view URL]('SMA',options=['EMA','HMA','SMA','WMA','RMA','VWMA'],title='RSI MA Type')
rma=rsimatype=='RMA'?[login to view URL](adjrsi,rsima):rsimatype=='HMA'?[login to view URL](adjrsi,rsima):rsimatype=='SMA'?[login to view URL](adjrsi,rsima):rsimatype=='WMA'?[login to view URL](adjrsi,rsima):rsimatype=='VWMA'?[login to view URL](adjrsi,rsima):[login to view URL](adjrsi,rsima)
rsi100=rma+[login to view URL](100)*(50/10)
rsi0=[login to view URL](100)*(50/10)
r100=plot(rsi100,linewidth=4,color=[login to view URL],title='RSI100')
r0=plot(rsi0,linewidth=4,color=[login to view URL](1, 165, 70),title='RSI0')
rsi90=rma+[login to view URL](100)*(30/10)
rsi10=[login to view URL](100)*(30/10)
r90=plot(rsi90,linewidth=2,color=[login to view URL],title='RSI90')
r10=plot(rsi10,linewidth=2,color=[login to view URL](1, 165, 70),title='RSI10')
fill(r100,r90,color=[login to view URL](255, 82, 82, 79),title='Overbought')
fill(r10,r0,color=[login to view URL](44, 248, 3, 79),title='Oversold')
r2=plot(rma,color=open>rma?#00ff00:open<rma?#ff0000:#f1e20e,title='RSI-50 Level',linewidth=2) //mid band
rsim=rma+[login to view URL](100)*(RsiMa - 50)/10
frsim=rma+[login to view URL](100)*(FastAtrRsiTL - 50)/10
o8=plot(rsim, color=#62f70bf5, title='QQE RSI',linewidth=2) //rsima
o2=plot(frsim, title='Fast RSI',color=#f30303,linewidth=2) //fast rsima
bgc2 = RsiMa - 50 > FastAtrRsiTL - 50 ? #144e055e : #8603035b
fill(o8,o2,color=bgc2,title='QQE Trend')
//thu=rma+[login to view URL](100)*10/10
//thl=[login to view URL](100)*10/10
//thup=plot(thu, title='Threshold+',color=#000000)
//thlo=plot(thl, title='Threshold-',color=#000000)
//fill(thup,thlo,color=[login to view URL](14, 17, 46, 87),title='Threshold Band') //threshold fill
qqeLong = QQExlong == 1 ? frsim: na
qqeShort = QQExshort == 1 ? frsim: na
plotshape(qqeLong, title="QQE long", text="Long", textcolor=[login to view URL]([login to view URL],0), style=[login to view URL], location=[login to view URL], color=[login to view URL](#216d1f, 0), size=[login to view URL])
plotshape(qqeShort, title="QQE short", text="Short", textcolor=[login to view URL]([login to view URL],0), style=[login to view URL], location=[login to view URL], color=#ff0000, size=[login to view URL])
// QQE exit from Thresh Hold Channel
plotshape(sQQEc and QQEclong == 1 ? rsim : na, title='QQE XC Over Channel', style=[login to view URL], location=[login to view URL], color=[login to view URL]([login to view URL], 0), size=[login to view URL], offset=0)
plotshape(sQQEc and QQEcshort == 1 ? rsim : na, title='QQE XC Under Channel', style=[login to view URL], location=[login to view URL], color=[login to view URL]([login to view URL], 0), size=[login to view URL], offset=0)
// QQE crosses
plotshape(sQQEx and QQExlong == 1 ? frsim : na, title='QQE XQ Cross Over', style=[login to view URL], location=[login to view URL], color=[login to view URL]([login to view URL], 0), size=[login to view URL], offset=-1)
plotshape(sQQEx and QQExshort == 1 ? frsim : na, title='QQE XQ Cross Under', style=[login to view URL], location=[login to view URL], color=[login to view URL]([login to view URL], 0), size=[login to view URL], offset=-1)
// Signal crosses zero line
plotshape(sQQEz and QQEzlong == 1 ? rsim : na, title='QQE XZ Zero Cross Over', style=[login to view URL], location=[login to view URL], color=[login to view URL]([login to view URL], 0), size=[login to view URL], offset=0)
plotshape(sQQEz and QQEzshort == 1 ? rsim : na, title='QQE XZ Zero Cross Under', style=[login to view URL], location=[login to view URL], color=[login to view URL]([login to view URL], 0), size=[login to view URL], offset=0)
alertcondition(qqeLong,title = 'QQE LONG',message='QQE LONG')
alertcondition(qqeShort,title = 'QQE SHORT',message='QQE SHORT')