Optimal martingale estimating equations in a stochastic process