So I modified your TMA Slope MTF indi to look at the values your GetSlope() uses. Excerpt of what I did:
Code: Select all
SetIndexBuffer(0, MAnow);
SetIndexBuffer(1, MAprev);
SetIndexLabel(0, "Now");
SetIndexLabel(1, "Prev");
// In start():
for ( i = 0; i < limit; i++ )
{
MAnow[i] = calcTmaTrue(Symbol(), 0, i) * 10000;
MAprev[i] = calcPrevTrue(Symbol(), 0, i) * 10000;
}E.g. on 31 Aug, GMT+0:
Time Prev Now
09:00 1.25178056 1.25184035
09:30 1.25218295 1.25225766
10:00 1.25264032 1.25273623
10:30 1.25316602 1.25328528
There are some pretty significant differences, considering how little it changes from bar to bar.
It looks to me like calcPrevTrue() is supposed to be equivalent to calcTmaTrue() on the previous bar. So I tried changing your GetSlope() code to:
Code: Select all
double dblTma = calcTmaTrue( symbol, tf, shiftWithoutSunday );
double dblPrev = calcTmaTrue( symbol, tf, shiftWithoutSunday+1 );What is calcPrevTrue( , , x) doing that's different to calcTmaTrue( , , x+1) ?? The only difference I see is that calcPrevTrue() inits the dblSum and dblSumw to iClose( symbol, tf, inx ) * 20 and 20, but I don't understand why -- why include the inx bar in the Prev calculation?? And why weight that one at 20, then weight inx+1 at 21, inx+2 at 20, etc??
I'd suspect there's a logic bug in there, but you and Neo's indicators produce the same results. He hasn't released his code so maybe he just "borrowed" your Slope code...