PD= Param("Lookback Period",30, 5, 220, 1);
MI= {Chande Momentum Osc (C,PD)}
((Sum(IIf(Close,>,Ref(Close,-1), (Close-Ref(Close,-1)),0),pd)) -
(Sum(IIf(Close,<,Ref(Close,-1), (Ref(Close,-1)- Close),0),pd))) /
((Sum(IIf(Close,>,Ref(Close,-1), (Close-Ref(Close,-1)),0),pd) +
(Sum(IIf(Close,<,Ref(Close,-1), (Ref(Close,-1)- Close),0),pd))))*100; // problem start here