Multicharts.net build in function

Questions about MultiCharts .NET and user contributed studies.
nightkid00
Posts: 5
Joined: 05 Jun 2014
Has thanked: 2 times

Multicharts.net build in function

Postby nightkid00 » 05 Jun 2014

Hi
I would like to use the "Summation" function in MC.net
is there any build in function for this ? or I need to build one on my own ?

By the way, where can I see all the build in function and description in MC.net.

Thanks

hairyMug
Posts: 57
Joined: 03 Feb 2014
Has thanked: 5 times
Been thanked: 6 times

Re: Multicharts.net build in function

Postby hairyMug » 06 Jun 2014

Bars.Close.Summation (in a strategy)

nightkid00
Posts: 5
Joined: 05 Jun 2014
Has thanked: 2 times

Re: Multicharts.net build in function

Postby nightkid00 » 08 Jun 2014

Bars.Close.Summation (in a strategy)

Thanks
But what if I want to calculate this :

Diff = AbsValue(Close - Close[1]);
nb = Summation(Diff, Period);

Is there a way to use the summation function in MC.net?

nightkid00
Posts: 5
Joined: 05 Jun 2014
Has thanked: 2 times

Re: Multicharts.net build in function

Postby nightkid00 » 09 Jun 2014

Bars.Close.Summation (in a strategy)

Thanks
What if I want to calculate only current bar and the previous bar , like this :

Diff = AbsValue(Close - Close[1]);
Result = Summation(Diff, Period);

How can I translate this into MC.Net?

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

Re: Multicharts.net build in function

Postby Henry MultiСharts » 18 Jun 2014

Hello nightkid00,

Please use the following code:

Code: Select all

using System;
using PowerLanguage.Function;

namespace PowerLanguage.Indicator{
public class summation : IndicatorObject {
public summation(object _ctx):base(_ctx){}

VariableSeries<Double> Diff;


protected override void Create() {
Diff = new VariableSeries<Double>(this);
}
protected override void StartCalc() {
// assign inputs
}
protected override void CalcBar(){
Diff.Value = Math.Abs(Bars.Close[0] - Bars.Close[1]);
double _summation = Diff.Summation(9);
Output.WriteLine("_summation = {0}", _summation);
}
}
}

nightkid00
Posts: 5
Joined: 05 Jun 2014
Has thanked: 2 times

Re: Multicharts.net build in function

Postby nightkid00 » 23 Jun 2014

Thanks.

I have another question

x = StdDev(MA-MA[1], Period) * z;

How can I translate this into MC.Net?

fltr_result.Value = PublicFunctions.StandardDeviation(f_result[0]) * z;


I used the PublicFunctions.StandardDeviation
but the parameter need the double[]

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

Re: Multicharts.net build in function

Postby Henry MultiСharts » 23 Jun 2014

Thanks.
I have another question
x = StdDev(MA-MA[1], Period) * z;
How can I translate this into MC.Net?
fltr_result.Value = PublicFunctions.StandardDeviation(f_result[0]) * z;
I used the PublicFunctions.StandardDeviation
but the parameter need the double[]
nightkid00, please use PublicFunctions.StandardDeviationCustom

nightkid00
Posts: 5
Joined: 05 Jun 2014
Has thanked: 2 times

Re: Multicharts.net build in function

Postby nightkid00 » 24 Jun 2014

Thanks.
I have another question
x = StdDev(MA-MA[1], Period) * z;
How can I translate this into MC.Net?
fltr_result.Value = PublicFunctions.StandardDeviation(f_result[0]) * z;
I used the PublicFunctions.StandardDeviation
but the parameter need the double[]
nightkid00, please use PublicFunctions.StandardDeviationCustom

Thanks.
The StandardDeviationCustom has 3 parameters and the last parameter is "int datatype"
what should I put on the last parameter ?

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

Re: Multicharts.net build in function

Postby Henry MultiСharts » 25 Jun 2014

Thanks.
The StandardDeviationCustom has 3 parameters and the last parameter is "int datatype"
what should I put on the last parameter ?
DataType: Numeric: 1 = population, 2 = sample


Return to “MultiCharts .NET”