I'm trying to calculate MACD and RSI formula in groovy. Regarding MACD, I've calculated up to MACD line but not able to calculate Signal line. Also does anyone have idea how to calculate RSI in groovy ? I know the RSI formula, RSI = 100 - 100/(1+RS) and RS = Avg Gain/ Avg Loss
But how to calculate Avg Gain and Avg Loss ? Can anyone explain with exact calculations ?