  Upcoming cosmic microwave background (CMB) experiments are expected to detect
new signals probing interaction of CMB photons with intervening large-scale
structure. Among these the moving-lens effect, the CMB temperature anisotropy
induced by cosmological structures moving transverse to our line of sight, is
anticipated to be measured to high significance in the near future. In this
paper, we investigate two possible strategies for the detection of this signal:
pairwise transverse-velocity estimation and oriented stacking. We expand on
previous studies by including in the analysis realistic simulations of
competing signals and foregrounds. We confirm that the moving lens effect can
be detected at $\ge 10\sigma$ level by a combination of CMB-S4 and LSST
surveys. We show that the limiting factors in the detection depend on the
strategy: for the stacking analysis, correlated extragalactic foregrounds,
namely the cosmic infrared background and thermal Sunyaev Zel'dovich effect,
play the most important role. The addition of foregrounds make the
signal-to-noise ratio be most influenced by large and nearby objects. As for
the pairwise detection, halo lensing and pair number counts are the main
issues. In light of our findings, we elaborate on possible strategies to
improve the analysis approach for the moving lens detection with upcoming
experiments. We also deliver to the community all the simulations and tools we
developed for this study.
