Variables in the RSI length

Questions about MultiCharts and user contributed studies.
tavr
Posts: 2
Joined: 11 Jan 2017

Variables in the RSI length

Postby tavr » 11 Mar 2017

I wrote a simple code in Signal:

Code: Select all

If XAverage (C, 10)> XAverage (C, 50) then value1 = 30 else value1 = 40;
Value2 = RSI (C, value1);
Compare the results value2 - RSI (30/40) in the table with RSI (C, 30) - RSI (30)

  D 1161229.00 T 1044.00 RSIPERIOD 30.00 RSI(30/40) 41.75 RSI(30) 40.08
  D 1161229.00 T 1046.00 RSIPERIOD 30.00 RSI(30/40) 37.48 RSI(30) 35.13
  D 1161229.00 T 1048.00 RSIPERIOD 30.00 RSI(30/40) 36.06 RSI(30) 33.52
  D 1161229.00 T 1050.00 RSIPERIOD 30.00 RSI(30/40) 31.93 RSI(30) 28.96
  D 1161229.00 T 1052.00 RSIPERIOD 30.00 RSI(30/40) 32.20 RSI(30) 29.29
  D 1161229.00 T 1054.00 RSIPERIOD 30.00 RSI(30/40) 31.32 RSI(30) 28.33
  D 1161229.00 T 1056.00 RSIPERIOD 30.00 RSI(30/40) 32.14 RSI(30) 29.35
  
Why are they different? Time period - thousands bars.

RSI (C, 30) with different data lengths of 1000 bars or 3000 always gives the same value?

Is this a bug?

Moreover, if the condition for the RSI period is more difficult, then the indicator data will differ from the signal data and the simple RSI (C, 30).
Last edited by tavr on 11 Mar 2017, edited 2 times in total.

User avatar
TJ
Posts: 7740
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2221 times

Re: Variables in the RSI length

Postby TJ » 11 Mar 2017

I wrote a simple code in Signal:

Code: Select all

If XAverage (C, 10)> XAverage (C, 50) value1 = 30 else value1 = 40;
Value2 = RSI (C, value2);
Compare the results value2 - RSI (30/40) in the table with RSI (C, 30) - RSI (30)

  D 1161229.00 T 1044.00 RSIPERIOD 30.00 RSI(30/40) 41.75 RSI(30) 40.08
  D 1161229.00 T 1046.00 RSIPERIOD 30.00 RSI(30/40) 37.48 RSI(30) 35.13
  D 1161229.00 T 1048.00 RSIPERIOD 30.00 RSI(30/40) 36.06 RSI(30) 33.52
  D 1161229.00 T 1050.00 RSIPERIOD 30.00 RSI(30/40) 31.93 RSI(30) 28.96
  D 1161229.00 T 1052.00 RSIPERIOD 30.00 RSI(30/40) 32.20 RSI(30) 29.29
  D 1161229.00 T 1054.00 RSIPERIOD 30.00 RSI(30/40) 31.32 RSI(30) 28.33
  D 1161229.00 T 1056.00 RSIPERIOD 30.00 RSI(30/40) 32.14 RSI(30) 29.35
  
Why are they different? Time period - thousands bars.

RSI (C, 30) with different data lengths of 1000 bars or 3000 always gives the same value?

Is this a bug?

Moreover, if the condition for the RSI period is more difficult, then the indicator data will differ from the signal data and the simple RSI (C, 30).


See post #5
The First Step in Writing Readable Codes:
Subtitle1: The First Step in Debugging Your Code
Subtitle2: Stop Banging Your Head Against the Wall and Open Your Eyes.
viewtopic.php?t=11713

tavr
Posts: 2
Joined: 11 Jan 2017

Re: Variables in the RSI length

Postby tavr » 11 Mar 2017

thank you


Return to “MultiCharts”