how can i compile this code (i get syntax errors):
Code: Select all
input fastLength = 3;
input slowLength = 10;
input MACDLength = 16;
def fastAvg = Average(data = close, length = fastLength);
def slowAvg = Average(data = close, length = slowLength);
plot Value = fastAvg – slowAvg;
plot Avg = Average(data = Value, length = MACDLength);
plot Diff = fastAvg – slowAvg;
plot ZeroLine = 0;
Value.SetDefaultColor(GetColor(1));
Avg.SetDefaultColor(GetColor(8));
Diff.SetDefaultColor(GetColor(5));
Diff.SetPaintingStrategy(PaintingStrategy.HISTOGRAM);
Diff.DefineColor(“Positive”, Color.UPTICK);
Diff.DefineColor(“Negative”, Color.DOWNTICK);
Diff.AssignValueColor(if diff >= 0 then Diff.color(“Positive”) else Diff.color(“Negative”));
ZeroLine.SetDefaultColor(GetColor(0));