I fast wrote a addon:

hello. please tell me how you can assign touch screen gestures to perform the functions of closing the currently active window and switching between active windows, as well as minimizing them? Source (RU)

Install, go to the NVDA menu, Parameters, Input Gestures, select close, minimize or switch in the category and use the Add button to assign a touch screen gesture to the selected command.