Hello guys
I would like to know if anybody could help me with some VBA code.
I have a sheet where I have to calculate the Relative strenght Index, right now I am doing it like this.....
In column A I have the "dates",
In column B I have the closing stock price on the day given in column A. In column C I calculate the daily return as todays closing price minus the previus day closing prices.
In column D I have this =IF(OR(C4>0;C4=0);C4;0), wich puts the days with positive returns in this column.
In column E I have this =IF(C4<0;ABS(C4);0), wich puts the days with negative returns in this colunm.
In column F I have =AVERAGE(D4:D15)/AVERAGE(E4:E15)
In column G I have =100-(100/(1+F15))
Oh my god, there has to be an easyer way to do this!!!!!!!
To read more on how its is calculatet, go here: http://www.investopedia.com/terms/r/rsi.asp
the formula is very simpel but Excel makes it very difficult to use, I was wondering if someone could make it as a function????
Jonas Hvid
I would like to know if anybody could help me with some VBA code.
I have a sheet where I have to calculate the Relative strenght Index, right now I am doing it like this.....
In column A I have the "dates",
In column B I have the closing stock price on the day given in column A. In column C I calculate the daily return as todays closing price minus the previus day closing prices.
In column D I have this =IF(OR(C4>0;C4=0);C4;0), wich puts the days with positive returns in this column.
In column E I have this =IF(C4<0;ABS(C4);0), wich puts the days with negative returns in this colunm.
In column F I have =AVERAGE(D4:D15)/AVERAGE(E4:E15)
In column G I have =100-(100/(1+F15))
Oh my god, there has to be an easyer way to do this!!!!!!!
To read more on how its is calculatet, go here: http://www.investopedia.com/terms/r/rsi.asp
the formula is very simpel but Excel makes it very difficult to use, I was wondering if someone could make it as a function????
Jonas Hvid