you have to add a reset of variables before loop:
0_1543321933122_781f308e-0435-4a24-badb-c8df7745b4bf-image.png
problem with not opening trades is not in the loop, it is in other conditions before AND block, trades are not opened:
0_1543322099440_f8e03566-5e53-4426-8be5-40329f863048-image.png
here are trades opened:
0_1543322168793_597c84fd-d409-4cf4-b284-663c3247935e-image.png
but this is not good, because each loop cycle where condition is true will open a trade ...
you have to create few logic changes:
0_1543322732405_2604b920-c958-4809-ada8-52664fd1a713-image.png