Put that variable into a comment block and see what is being returned... if trade placed is not from the same EA you are reading this value you need to select all automatic and manually placed in the group option