lil wrote:
talking about the 5th argument: int timePeriod
sorry monsieur
lil wrote:
this one looks mysterious to me
To calculate RSI you need to define a period (like 15 min), and a lookback (like 14, which is the default). This means that you will use the last 14 15M bars to calculate the value of RSI. The javadoc uses
period for the chart's period, and
timePeriod for the lookback, which could be confusing, as both contains the word, period. Now, which one does what? I think it would be better if we call them
period and
lookback, but this is just a personal opinion.
To have a grasp on these parameter, just put RSI on a chart on the platform:
When you put RSI indicator on the chart, the chart's period (like 15M or 4H) will be the
period parameter of the indicator, and the
lookback is a changeable indicator parameter (with 14 as default). If you change the chart's period to, let's say, to 4H, and leave Time period (which I called
lookback) on 14, then for RSI calculation you will use the last 14 4H bars.
When you use the API, the 5th parameter is the lookback parameter. And as JLongo pointed out, it cannot be an enum, as you can use whatever number (integer of course) you want.
More on calculating RSI can be found (for example)
here.
I hope this helps.