as an absolute beginner in c#, I have the following question to ask.
Is it possible to export multiple VariableSeries from a function to an indicator?
Let's say I have this function:
Code: Select all
using System;
namespace PowerLanguage
{
namespace Function
{
public sealed class SomeVolumeCalculations : FunctionSeries<System.Int32>
{
public SomeVolumeCalculations(CStudyControl _master) : base(_master) { }
public SomeVolumeCalculations(CStudyControl _master, int _ds) : base(_master, _ds) { }
public VariableSeries<int> myVolumeUp;
public VariableSeries<int> myVolumeDn;
protected override void Create()
{
myVolumeUp = (VariableSeries<int>)CreateSeriesVar<int>();
myVolumeDn = (VariableSeries<int>)CreateSeriesVar<int>();
}
protected override void StartCalc()
{
myVolumeUp.Value = 0;
myVolumeDn.Value = 0;
}
protected override System.Int32 CalcBar()
{
//Some calculations here, maybe:
myVolumeUp.Value = (int)Bars.UpTicks[0];
myVolumeDn.Value = (int)Bars.DownTicks[0]*-1;
return default(System.Int32);
// return ????
}
}
}
}
and I want to return both myVolumeUp and myVolumeDn to the indicator.
Is it possible to find an example?
If not, can someone help me to complete this function code and to write the indicator code?
Thank you very much.