Would you like to have an indicator that measures just the probability for the next tick that the prices will go up?
Well, this is the RSI indicator.
Indeed, let in the last N ticks we had k anode ticks and m falling ticks.
We will consider the obvious assumption that the process is ergodic, i.e. the last statistical behaviour of the process is more or less repeated.
Then the probability p which we are looking for is:
p = 100 * (number k of anode ticks in the last N ticks) / (total number N of all ticks)
So,
p = 100 * k/N
Then,
p = 100 * k/N
p = 100 * (N - m) / N
p = 100 * (1 - m/N)
p = 100 - 100 * m/N
p = 100 - 100 * m/(k + m)
p = 100 - 100 * (1/(k/m + 1)
p = 100 - 100 /(1+ k/m)
Indeed, Welles Wilder defined the RSI as
RSI = 100 - 100 / (1 + k/m)
where k/m = (Closes Up) / (Closes Down)
So for example, if for the last N = 100 ticks you have RSI = 56, this practically means that for the next tick you have 56% probability that the prices will go up.
Here is an example of calling Talib RSI function:
RSIresults = talib.RSI
inReal: instrument.close
startIdx: 0
endIdx: instrument.close.length-1
optInTimePeriod: context.period
rsi = _.last(RSIresults)[/color]