I could sure use some help here. Maybe I am doing something wrong, but it seems nearly any indicator I want to write needs to do what I am trying to accomplish here. Would sure be helpful if this was a well documented case.
Here is what I have and have completely hit a wall. The indicator is erroring out when it hits myTEMA.Current. Count is zero. Obviously no data being associated with this overload. Not clear to me how to pass that Generic List and how to calculate TEMA on it.
This is the last bits holding me up. Would appreciate any guidance that gets me to enlightenment.
public class MyTEMA : ISeries
{
List myTEMA = new List();
public MyTEMA(int period, List myTEMA)
: base()
{
return;
}
public SeriesChartSettings ChartSettings { get; set; }
public double LookBack(int nBars)
{
return myTEMA[myTEMA.Count - nBars];
}
public double Current
{
get { return myTEMA[myTEMA.Count - 1]; }
}
public int Count
{
get { return myTEMA.Count; }
}
public bool OldValuesChange
{
get { return false; }
}
public int OldestValueChanged
{
get { return 0; }
}
}