How to test whether your backtest is affected

You can copy both versions into your script and compare them bar by bar.

Code
// Old MMI version
var MMI_old(vars Data,int TimePeriod)
{
    TimePeriod = Min(TimePeriod,1000);
    checkLookBack(TimePeriod);
    TimePeriod = Min(TimePeriod,g->nBar-1);

    if(TimePeriod < 2)
        return 75;

    var m = Median(Data,TimePeriod);

    int i, nh = 0, nl = 0;

    for(i = 1; i < TimePeriod; i++)
    {
        if(Data[i] > m && Data[i] > Data[i-1])
            nl++;
        else if(Data[i] < m && Data[i] < Data[i-1])
            nh++;
    }

    return 100.*(nl+nh)/(TimePeriod-1);
}


// New MMI version
var MMI_new(vars Data,int TimePeriod)
{
    TimePeriod = Min(TimePeriod,1000);
    checkLookBack(TimePeriod);
    TimePeriod = Min(TimePeriod,g->nBar-2);

    if(TimePeriod < 2)
        return 75;

    var m = Median(Data,TimePeriod|1);

    int i, nh = 0, nl = 0;

    for(i = 1; i < TimePeriod; i++)
    {
        if(Data[i] > m && Data[i] > Data[i-1])
            nl++;
        else if(Data[i] < m && Data[i] < Data[i-1])
            nh++;
    }

    return 100.*(nl+nh)/(TimePeriod-1);
}


function run()
{
    BarPeriod = 60;
    LookBack = 300;

    asset("EUR/USD");

    vars Price = series(priceClose());

    int Period = 100;

    var OldMMI = MMI_old(Price,Period);
    var NewMMI = MMI_new(Price,Period);

    plot("Old MMI",OldMMI,NEW,BLUE);
    plot("New MMI",NewMMI,0,RED);
    plot("Difference",NewMMI-OldMMI,NEW,GREEN);

    static int ValueDiffs = 0;
    static int SignalDiffs = 0;

    if(!is(LOOKBACK))
    {
        if(abs(NewMMI-OldMMI) > 0.0001)
            ValueDiffs++;

        int OldSignal = OldMMI > 75;
        int NewSignal = NewMMI > 75;

        if(OldSignal != NewSignal)
        {
            SignalDiffs++;
            printf("\nBar %i: Old MMI %.2f, New MMI %.2f",Bar,OldMMI,NewMMI);
        }
    }

    if(is(EXITRUN))
    {
        printf("\nMMI value differences: %i",ValueDiffs);
        printf("\nMMI signal differences: %i",SignalDiffs);
    }
}



What to look for

If the green Difference plot is often zero, your backtest is probably not affected.

If you see many lines like:

Old MMI 74.95, New MMI 75.12

and your system uses a threshold near 75, then your backtest can change.

The highest-risk cases are:

Code
if(MMI(Price,Period) > 75)
if(MMI(Price,Period) < 50)
if(crossOver(MMI_Series,Threshold))


The lowest-risk case is when MMI is only plotted and not used for trading decisions.