Did you make any progress here? I have the same problem using the routine
Code:
if (TradeMAE/PIP > 90)
		return 1;
	else
		return 0;


in a TMF expecting a plotMAEGraph with many trades ending around 90 but many trades go far beyond this border.