I've been studying MTF code and am shocked by a test plot I received today. I'm testing the following plots:
SMA - built-in NT code
SMAtest - copy of built-in code with the addition of this line:
if (CurrentBar < period) return;
if (CurrentBar < period || CurrentBars[1] < period) return;
SMAFromRangeBarstest1 - with this commented out
//if (CurrentBar < period || CurrentBars[1] < period) return;
I'm attaching the 3 files in a zip along with a screenshot.
The SMAtest shows a different plot. I've been adding that piece of code to many files I've been working on and only now realize that it gives a different Plot.
Please tell me if there's a problem with my code and/or why adding this piece of code is required/not required for certain code types.
Kirk



). Of course, the NT calculation is absolutely correct. I had already checked it a long time ago, and found that it was only correct for fixed periods, which is when I wrote another one that could use a variable period. That may have misled my mind into the parallel line of thinking that there was a fundamental issue, and my wrong critique.
Comment