MC_BUG ? Plot2 RSI's, one on data1 and one on data2-HELP !

Questions about MultiCharts and user contributed studies.
brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

MC_BUG ? Plot2 RSI's, one on data1 and one on data2-HELP !

Postby brodnicki steven » 14 Nov 2008

I can't get two RSI's to plot correctly in the same study window in two different time frames, it's driving me crazy, I must be missing something, or is it an MC bug ?

Here is the code I'm using:(I'm not a programmer but I've done something similar in TS2ki years ago and it worked)

vars:intrabarpersist Rsd1(0),intrabarpersist Rsd2(0,data2);

rsd1 = rsi(c,14);
rsd2 = rsi(c of data2,14);

plot1(rsd1,"rsd1");
plot2(rsd2 ,"rsd2");
plot3(50,"fifty");

Since this is applied to Data1 it doesn't accurately get the value of data2. The photo attached shows the values in red for the rsi's applied to data 2, they don't match. The upper rsi is applied to data2, the lower rsi is applied to data1 and is trying to call the value on data2. (Ver4 beta3)
I could just overlap the indicators in one window but then the scaling would be off.(zero lines wouldn't match etc)
Attachments
RSI Data2.jpg
RSI Data2.jpg (101.75 KiB) Viewed 530 times

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 28 Nov 2008

Hi Steven,

The RSI function uses serial variables (referencing previous values).
These variables change within the context of the data series to which an indicator is applied.

Example1:

Code: Select all

rsd2 = rsi(c of data2,14);

In the example above, the argument uses data2 values. At the same time, variables in RSI are based on the data series to which the indicator is applied (data1)

Example 2

Code: Select all

rsd2 = rsi(c, 14) of data2;

In the second example, data2 is take nfor the RSI function (for internal variables and for the arguments)

Code: Select all

rsd2 = rsi(c, 14) of data2;

and

Code: Select all

rsd2 = rsi(c of data2, 14) of data2;

are equivalent

In other words, all you need to do is modify the code. Instead of

Code: Select all

rsd2 = rsi(c of data2,14);
use

Code: Select all

rsd2 = rsi(c of data2,14) of data2;


Regards.

brodnicki steven
Posts: 407
Joined: 01 Jan 2008
Been thanked: 3 times

Postby brodnicki steven » 28 Nov 2008

Great , thanks Marina, I'll try that !

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 01 Dec 2008

Hi Steven,

Let me know how that has worked out for you.

Regards.

Iris Yeung
Posts: 4
Joined: 25 Aug 2007

Postby Iris Yeung » 11 Dec 2008

Hi Marina,

I got an error message "Message: Error in study "Name":STD exception: invalid argument" on the following code:

plot1(RSI(C of data2 ,14) of data2,"rsd2");

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

Postby 2haerim » 11 Dec 2008


User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 18 Dec 2008

Hi Marina,

I got an error message "Message: Error in study "Name":STD exception: invalid argument" on the following code:

plot1(RSI(C of data2 ,14) of data2,"rsd2");


Dear Iris,

This problem has been confirmed as a bug and it will be fixed in one of the future versions of MC.

Regards.

sylfvdk
Posts: 57
Joined: 06 Dec 2005

Postby sylfvdk » 25 Dec 2008

I just want to add that not only RSI gives an error : 'STD exception: invalid argument' when used with not data it based on. Also DMI, ADX and I believe others have the same bug.

It worked on version 3. And Since Version 4 - getting this error. Please, release patch for that ASAP. Need it in beta 2 of Release5. All my studies are stocked with this.

Thanks, Victor


Return to “MultiCharts”