Can anyone tell me why the following will work fine and I get the appropriate plot:
fastEma.Set(SMA(Input, Fast)[0]);
slowEma.Set(SMA(Input, Slow)[0]);
double macd = fastEma[0] - slowEma[0];
double Ymacd = fastEma[1] - slowEma[1];
double macdAvg = (2.0 / (1 + Smooth)) * macd + (1 - (2.0 / (1 + Smooth))) * Avg[1];
Value.Set(macd);
Avg.Set(macdAvg)
Diff.Set(macd);
But after I make the following change the indicator compiles just fine but all plots disappear (line #5 is new):
fastEma.Set(SMA(Input, Fast)[0]);
slowEma.Set(SMA(Input, Slow)[0]);
double macd = fastEma[0] - slowEma[0];
double Ymacd = fastEma[1] - slowEma[1];
double YYmacd = fastEma[2] - slowEma[2];
double macdAvg = (2.0 / (1 + Smooth)) * macd + (1 - (2.0 / (1 + Smooth))) * Avg[1];
Value.Set(macd);
Avg.Set(macdAvg);
Diff.Set(macd);
Thanks in advance.
Bob
Comment