It looks like you did not add public properties for your plots. Just as a heads up in the future its best to use the new indicator wizard to create plots for your script, when you create a new indicator you can use the plots section to add your plots. That will also create the public properties.
Without adding any more code you can use the Values collection like the following:
if (EMA(Input, fastPeriod)[0] < EMA(Input,slowPeriod)[0])
{
Values[0][0] = EMA(Input, fastPeriod)[0];
Values[0][1] = EMA(Input, fastPeriod)[1];
}
else
{
Values[1][0] = EMA(Input, fastPeriod)[0];
Values[1][1] = EMA(Input, fastPeriod)[1];
}
If you wanted to use MyEMAGreen and MyEMARed you need to add the public properties for those two plots, the properties look like the following:
[Browsable(false)]
[XmlIgnore]
public Series<double> MyEMAGreen
{
get { return Values[0]; }
}
[Browsable(false)]
[XmlIgnore]
public Series<double> MyEMARed
{
get { return Values[1]; }
}

Comment