  In this paper, we study the stochastic optimal control problem for control
system with time-varying delay. The corresponding stochastic differential
equation is a kind of stochastic differential delay equation. We prove the
existence and uniqueness of the solution of this equation. We obtain the
stochastic maximum principle of the control system with time-varying delay by
introducing a kind of generalized anticipated backward stochastic differential
equations. We prove the existence and uniqueness of the solution of this
adjoint equation. As an application, the linear quadratic moving average
control problem is investigated to illustrate the main result.
