The code is so hopelessly simple that I'm embarrassed I've spent the last hour and still can't get it to plot. I'm obviously overlooking something very basic and was hoping someone could take a look at it.
This is the Metastock code and I've attached the MetaTrader indicator (which I tried to convert)
Chande's Trendscore If(C>=Ref(C,-11),1,-1) + If(C>=Ref(C,-12),1,-1) + If(C>=Ref(C,-13),1,-1) + If(C>=Ref(C,-14),1,-1) + If(C>=Ref(C,-15),1,-1) + If(C>=Ref(C,-16),1,-1) + If(C>=Ref(C,-17),1,-1) + If(C>=Ref(C,-18),1,-1) + If(C>=Ref(C,-19),1,-1) + If(C>=Ref(C,-20),1,-1)
for (score=0,k=0; k<LookBackLength; k++) if (Close[i] >= Close[i+k+LookBack]) score++; else score--; TrendBuffer[i] = score/LookBackLength;
for (score=0,k=0; k<LookBackLength; k++) if (Close[0] >= Close[k+LookBack]) score++; else score--; TrendBuffer.Set(score/LookBackLength);

thanks in advance.
Comment