RSIPeriod = 2
for i = 0 to 10000
RSIRevValue = i/100
REM Original RSI values
RSIOri = RSI[RSIPeriod](close)
UPOri = MAX(0, close - open) //higher close then previous
DOWNOri = MAX(0, open - close) //lower close then previous
upMAOri = wilderAverage[RSIPeriod](UPOri)
downMAOri = wilderAverage[RSIPeriod](DOWNOri)
REM Reversed Engineered RSI Value to Price
RSRev = (100/((-1*RSIRevValue)+100))-1
if RSIRevValue < RSIOri THEN
upMARev = upMAOri*(1-(1/RSIPeriod))
downMARev = upMARev/RSRev
DOWNRev = (downMARev - (downMAOri * (1-(1/RSIPeriod))))/(1/RSIPeriod)
RSIPriceRev = close - DOWNRev
elsif RSIRevValue > RSIOri THEN
downMARev = downMAOri*(1-(1/RSIPeriod))
upMARev = downMARev*RSRev
UPRev = (upMARev - (upMAOri * (1-(1/RSIPeriod))))/(1/RSIPeriod)
RSIPriceRev = close + UPRev
endif
if RSIPriceRev >= average[2](low) then
myRSI = RSIRevValue
break
endif
next
//Dummy Trade
if average[2] = -1 then
buy at market
endif
graph myRSI