RSI as an OHLC indicator ? - page 2

 
nicholishen:

No need to do anything with ticks. The key to RSI OHLC is using the bar OHLC. Since the RSI is using close prices, on the RSI calculation for the current bar (selected by index) you would change the close price to the high,low,etc.

Anyway... I got a little bit carried away with it.. here's the indicator.

That's not exact.

Getting OHLC values on RSI (close as standard price), is not the same as calculating RSI on OHLC.

 
Alain Verleyen:

That's not exact.

Getting OHLC values on RSI (close as standard price), is not the same as calculating RSI on OHLC.


Oh, yes it is!

You may be thinking I'm calling the iRSI with PRICE_HIGH..etc. This is not that at all! This is totally recalculating the RSI with all periods using close price except for the very last period. Have a look at my Rsi method... it's tapping into the diff-buffers and doesn't even touch the RSI buffer. 

current.high - prev.close to recalculate the RSI yields the same exact result as collecting the RSI using ticks.

 
nicholishen:

Oh, yes it is!

You may be thinking I'm calling the iRSI with PRICE_HIGH..etc. This is not that at all! This is totally recalculating the RSI with all periods using close price except for the very last period. Have a look at my Rsi method... it's tapping into the diff-buffers and doesn't even touch the RSI buffer. 

current.high - prev.close to recalculate the RSI yields the same exact result as collecting the RSI using ticks.


If you still don't believe me, compile my Indicator, set your chart to M1, and drop an RSI on top of it as an overlay. You'll see.


...you just gotta think outside of the box ;)

 
nicholishen:

Oh, yes it is!

You may be thinking I'm calling the iRSI with PRICE_HIGH..etc. This is not that at all! This is totally recalculating the RSI with all periods using close price except for the very last period. Have a look at my Rsi method... it's tapping into the diff-buffers and doesn't even touch the RSI buffer. 

current.high - prev.close to recalculate the RSI yields the same exact result as collecting the RSI using ticks.

I was effectively thinking you mean calculating RSI with PRICE_OPEN, HIGH, etc...

I checked your indicator and it works, congrats. However it's horribly slow, it freezes my platform for a while on each tick (my computer is old).

You should stop bragging it's indecent.

 
Alain Verleyen:

I was effectively thinking you mean calculating RSI with PRICE_OPEN, HIGH, etc...

I checked your indicator and it works, congrats. However it's horribly slow, it freezes my platform for a while on each tick (my computer is old).

You should stop bragging it's indecent.


Slow is the price you pay for getting this done in MT4... 

Edit: here's a quick optimization that cut the processing in half.
Files:
RSIBars.mq4  2 kb
RsiBar.mqh  4 kb
 

Hi nicholishen, thanks for the indicator. Compiled it, but not getting any bars on the subwindow !!!! Why ?

Files:
 
Joao:

Hi nicholishen, thanks for the indicator. Compiled it, but not getting any bars on the subwindow !!!! Why ?

Because you renamed it and didn't update the WindowsFind function with the new name.

Did you check the log?
 
nicholishen:
Because you renamed it and didn't update the WindowsFind function with the new name.

Did you check the log?
It's renamed automatically by the site.
 
Alain Verleyen:
It's renamed automatically by the site.

Wow, you'd think MQ would've had a little better fore-site when implementing that feature... then again I guess that kind of thing should be expected by now...


OP, rename the files to "RSIBars.mq4" and "RSIBar.mqh"

 
nicholishen:

Wow, you'd think MQ would've had a little better fore-site when implementing that feature... then again I guess that kind of thing should be expected by now...


OP, rename the files to "RSIBars.mq4" and "RSIBar.mqh"

In the past I lost hours figuring out why an EA was not working for a customer (a space in an indicator name was automatically removed). Once it happened you will never forget it.
Reason: