Different price input for BuiltIn-Function  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
PK1
Posts: 102
Joined: 12 Jun 2011
Has thanked: 42 times
Been thanked: 12 times

Different price input for BuiltIn-Function

Postby PK1 » 19 Mar 2014

While evaluating .Net (actually I wanted to change from MC to MC.Net) several times I came upon the problem of the need for different input to an indicator (see example below). Thats a big disadvantage of the .Net-Version over PL-Version. Is there any kind of workaround doing this Indicator over Indicator - Thing in my code?

Code: Select all

// -- MC --
rsiBase = (Close of data1) * factor;
rsi = RSI(rsiBase, 18);

// -- MC.Net --
private Function.RSI m_rsi;
m_rsi.price = Bars.Close * factor; // doesn't work due to type incompatibilities
As far as I've heard Indicator over Indicator won't be possible in MC.Net 9.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Different price input for BuiltIn-Function

Postby Henry MultiСharts » 20 Mar 2014

Hello PK1,

Here is the proper code:

Code: Select all

m_rsi.price = new Lambda<double>(_barsBack => Bars.Close[_barsBack] * factor);
Is there any kind of workaround doing this Indicator over Indicator - Thing in my code?
As far as I've heard Indicator over Indicator won't be possible in MC.Net 9.
Since MultiCharts .NET 8.8 objects of one study are accessible from the other one. You can find code examples here and here.

PK1
Posts: 102
Joined: 12 Jun 2011
Has thanked: 42 times
Been thanked: 12 times

Re: Different price input for BuiltIn-Function  [SOLVED]

Postby PK1 » 20 Mar 2014

Code: Select all

m_rsi.price = new Lambda<double>(_barsBack => Bars.Close[_barsBack] * factor);
I guess that should do it! Thank You, Henry!


Return to “MultiCharts .NET”