In this paper, we will study an indefinite stochastic linear quadratic optimal control problem, where the controlled system is described by a stochastic differential equation with delay. By introducing the relaxed compensator as a novel method, we obtain the well-posedness of this linear quadratic problem for indefinite case. And then, we discuss the uniqueness and existence of the solutions for a kind of anticipated forward–backward stochastic differential delayed equations. Based on this, we derive the solvability of the corresponding stochastic Hamiltonian systems, and give the explicit representation of the optimal control for the linear quadratic problem with delay in an open-loop form. The theoretical results are validated as well on the control problems of engineering and economics under indefinite condition.