  In this article we reconsider a version of quantum trajectory theory based on
the stochastic Schr\"odinger equation with stochastic coefficients, which was
mathematically introduced in the '90s, and we develop it in order to describe
the non Markovian evolution of a quantum system continuously measured and
controlled thanks to a measurement based feedback. Indeed, realistic
descriptions of a feedback loop have to include delay and thus need a non
Markovian theory. The theory allows to put together non Markovian evolutions
and measurements in continuous time in agreement with the modern axiomatic
formulation of quantum mechanics. To illustrate the possibilities of such a
theory, we apply it to a two-level atom stimulated by a laser. We introduce
closed loop control too, via the stimulating laser, with the aim to enhance the
"squeezing" of the emitted light, or other typical quantum properties. Note
that here we change the point of view with respect to the usual applications of
control theory. In our model the "system" is the two-level atom, but we do not
want to control its state, to bring the atom to a final target state. Our aim
is to control the "Mandel $Q$-parameter" and the spectrum of the emitted light;
in particular the spectrum is not a property at a single time, but involves a
long interval of times (a Fourier transform of the autocorrelation function of
the observed output is needed).
