AverageMTF Fuction
Inputs: Factor( numericsimple ), Price( numericseries ), Length( numericsimple );
Variables: Sum( 0 ), Count( 0 ), Vector( 0 );
Vector = PriceMTF( Factor, Price );
Sum = 0;
If MTF( Factor ) Then
Begin
For Count = 0 to Length - 1
Begin
Sum = Sum + Vector[ Count * Factor ];
End;
AverageMTF = Div( Sum, Length );
End
Else
AverageMTF = AverageMTF[1];