When to use function.Call()  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
cms
Posts: 4
Joined: 16 Jun 2015
Location: Sweden

When to use function.Call()

Postby cms » 16 Jun 2015

Hello,

I wonder when it's required, or correct, to use the Call() method. What about this case?

protected override void CalcBar(){
function.prop=a.Value;
my.Value=function.Value;
plot1.Set(my.Value);
}

Should I have a function.Call() in there somewhere?

Regards,
Christer

cms
Posts: 4
Joined: 16 Jun 2015
Location: Sweden

Re: When to use function.Call()

Postby cms » 17 Jun 2015

Does it matter if function is FunctionSeries or FunctionSimple?

//Christer

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

Re: When to use function.Call()  [SOLVED]

Postby Henry MultiСharts » 17 Jun 2015

Hello cms,

You need to use function.Call only when the body of the series function is not being called for calculation directly. For example:

Code: Select all

if(MyCondition)
SomeValue = myfunction[0];
else
myfunction.Call();
Otherwise if you do not use function.Call where you need it - MultiCharts will do that for you, but at the end of the script calculation on the current bar. Depending on the code it can affect the function calculation results.

cms
Posts: 4
Joined: 16 Jun 2015
Location: Sweden

Re: When to use function.Call()

Postby cms » 17 Jun 2015

I see, thank you!


Return to “MultiCharts .NET”