Page 1 of 1

RSI indicator on tick graph

Posted: Mon Mar 23, 2009 7:32 am
by 10550741
I am trying to use TRSIFunction with a DataSource of TLineSeries and not TCandleSeries but I am receiving an exception.

As far as I know the RSI indicator has meaning also in tick graphs (when every half second or so you have point on the line series).

Any ideas how can I accomplish that?

Thanks

Posted: Mon Mar 23, 2009 4:00 pm
by narcis
Hi Shimon,

At the present moment TRSIFunction only accepts TCandleSeries as a datasource. I'll add your request to the wish-list to be considered for inclusion in future releases.

In the meantime, the only solution I can think of is internally using a dummy candle series (not visible) with line values so that RSI function can be calculated.

Posted: Mon Mar 23, 2009 5:31 pm
by 10550741
How do you suggest to compute the dummy candle series ?

Take each point as a candle in this case the open and close and high low will be equal.

Posted: Tue Mar 24, 2009 9:50 am
by yeray
Hi Shimon,

Note that, as explained here, the RSI function calculates line points differencing between "positive" days and "negative" days. So, I'm not sure on the meaning of having only "unsigned" days.

Here is an example but, of course, the RSI results in a horizontal line at 100:

Code: Select all

// series1: source line series
// series2: dummy candle series
// teefunction1: RSI function

uses DateUtils;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  for i:=0 to 25 do
    Series1.AddXY(Today + OneHour*24*i, random*1000);

  for i:=0 to Series1.Count-1 do
    Series2.AddCandle(Series1.XValue[i], Series1.YValue[i], Series1.YValue[i], Series1.YValue[i], Series1.YValue[i]);

  Series1.XValues.DateTime := true;
  TeeFunction1.Period := 2;
  Series2.Visible := false;
end;