# How to predict RSI Level???

Hello all.

excuse me for my english.

can anybody help me how to predict RSI level?

actually i mean how to use RSI's formull in my code?

for example:

at EUR/USD chart i have this now:

and RSI level with 8 period has 48.4325 value.

i want to use RSI formull and see this:

if in this candle price go up to "X" so RSI will go to what value?

best regards

qjol:
iRsi()

but i know that.

my problem is something else.

i'm going to calculate rsi with my code.

for example:

RSI is 45.0000 now and price is 1.3225 and RSI period is 8.

how can i calculate this:

if(price==X) {RSI=50;}

no need to calculate anything

```if (PRICE == X && iRsi(bla bla) == Y)
{
do X Y Z;
}```

qjol:

no need to calculate anything

thank you dear qjol.

but i need it for my signaler indicator.

it have to predict this value for probably prices in ich candle.

can you help me?

you need to reverse the RSI formula, should be basic math. If you want to know what price is neccesary that the RSI will be 50 then only one variable is left.

i have the price for calculate RSI value.

i tried get it with RSI formula, but i couldn't.

maniac1984:

i have the price for calculate RSI value.

i tried get it with RSI formula, but i couldn't.

This is non-trivial as you need the last N bars worth of data

I would suggest calculating the RSI for yourself in an indicator and comparing it to a real RSI indicator to check your coding. Having calculated it yourself from first principles it should be easier to see how to work it backwards for just the last day.

I think what Maniac meant is how to get the current price of a running currency pair when an RSI hits an oversold or overbought level, because that is what my problem is now as I tried using the PRICE_CLOSE but when I debug by checking the journal it just says the value is zero (which we obviously know is not).

I attached an image screenshot which I hope would better visualise the point I am (or maybe Maniac is) getting at.

Files:

tompips2018:

I think what Maniac meant is how to get the current price of a running currency pair when an RSI hits an oversold or overbought level, because that is what my problem is now as I tried using the PRICE_CLOSE but when I debug by checking the journal it just says the value is zero (which we obviously know is not).

I attached an image screenshot which I hope would better visualise the point I am (or maybe Maniac is) getting at.

Hmm... if you check RSI bar 0, then when it hits 70, the price you need will be Bid... but if you check RSI bar 1 or beyond, then the price will become the candle's close price, which can be retrieved via the iClose() function...

Seng Joo Thio:

Hmm... if you check RSI bar 0, then when it hits 70, the price you need will be Bid... but if you check RSI bar 1 or beyond, then the price will become the candle's close price, which can be retrieved via the iClose() function...

"but if you check RSI bar 1 or beyond, then the price will become the candle's close price, which can be retrieved via the iClose() function..."

That's exactly what I need, I'm going to use it as a Stop Loss Level for both Overbought/sold thresholds.

Thanks again. Very much appreciated :-) .

```      RSILevel = iRSI(_Symbol, _Period, 14, PRICE_CLOSE, 0);

if (RSILevel > 70)
{
Signal = "Sell";
PriceAtRSILevel = iClose(_Symbol,0,0);
if (DEBUGSwitch == true) Print("Price for Selling: ",PriceAtRSILevel);
}

// If it is below 70
if (RSILevel < 30)
{
PriceAtRSILevel = iClose(_Symbol,0,0);
if (DEBUGSwitch == true) Print("Price for Buying: ",PriceAtRSILevel);
}
```