  Optimally doped YBCO (YBa$_{2}$Cu$_{3}$O$_{7}$) has a high critical
temperature, at 92 K. It is largely believed that Cooper pairs form in YBCO and
other cuprates because of spin fluctuations, the issue and the detailed
mechanism is far from settled. In the present work, we employ a
state-of-the-art \emph{ab initio} ability to compute both the low and high
energy spin fluctuations in optimally doped YBCO. We benchmark our results
against recent inelastic neutron scattering and resonant inelastic X-ray
scattering measurements. Further, we use strain as an external parameter to
modulate the spin fluctuations and superconductivity. We disentangle the roles
of Barium-apical Oxygen hybridization, the interlayer coupling and orbital
symmetries by applying an idealized strain, and also a strain with a fully
relaxed structure. We show that shortening the distance between Cu layers is
conducive for enhanced Fermi surface nesting, that increases spin fluctuations
and drives up $T_{c}$. However, when the structure is fully relaxed electrons
flow to the d$_{z^2}$ orbital as a consequence of a shortened Ba-O bond which
is detrimental for superconductivity
