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
Multicharts.net build in function
-
- Posts: 5
- Joined: 05 Jun 2014
- Has thanked: 2 times
Re: Multicharts.net build in function
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?
-
- Posts: 5
- Joined: 05 Jun 2014
- Has thanked: 2 times
Re: Multicharts.net build in function
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?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Multicharts.net build in function
Hello nightkid00,
Please use the following code:
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);
}
}
}
-
- Posts: 5
- Joined: 05 Jun 2014
- Has thanked: 2 times
Re: Multicharts.net build in function
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[]
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[]
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Multicharts.net build in function
nightkid00, please use PublicFunctions.StandardDeviationCustomThanks.
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[]
-
- Posts: 5
- Joined: 05 Jun 2014
- Has thanked: 2 times
Re: Multicharts.net build in function
nightkid00, please use PublicFunctions.StandardDeviationCustomThanks.
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[]
Thanks.
The StandardDeviationCustom has 3 parameters and the last parameter is "int datatype"
what should I put on the last parameter ?
- Henry MultiСharts
- Posts: 9165
- Joined: 25 Aug 2011
- Has thanked: 1264 times
- Been thanked: 2958 times
Re: Multicharts.net build in function
DataType: Numeric: 1 = population, 2 = sampleThanks.
The StandardDeviationCustom has 3 parameters and the last parameter is "int datatype"
what should I put on the last parameter ?