ok, i see what you want to do with it. But currently the blocks do nothing. The first block calculates a variable for each tick and the second block checks whether a trand is nearby, but nothing else happens. So no matter whether a trade is close or not, no further action, no buy sell or change of a variable takes place.