I'm trying to code and indicator. I dont want to plot it but I want it to be re-used again and again so its a kind of function.
I have created a DataSeries called fastK and I'm setting it up as follows.
double curC = Close[0];
double var0= MIN(Close,40)[0];
double var1 = MAX(High,40)[0];
double var2 = curC - var0;
double var3 = var1-var0;
if (var3>0)
{
fastK.Set( var2 / var3 * 100);
}
else
{
fastK.Set(0);
}
}
#region Properties
[Browsable(false)]
[XmlIgnore()]
public DataSeries fastK
{
get {return fastK;}
}
#endregion
and at Initialize() method i write fastK = new DataSeries(this);
now the problem is, as u can see, I want that fastK to be exposed for another indicators. so i try make it public in #region Properties section. but I get an error that
Indicator\fastKCustom.cs The type 'NinjaTrader.Indicator.fastKCustom' already contains a definition for 'fastK' CS0102 - click for info 70 21
What am i doing wrong ??
Thanks, And also How can i get average of this same indicator while i using it in another indicator ? (plz help i m not able to do things easily in ninja)
Regards

Comment