The backslash character '\' at the end of every line is a 'continuation of line' character-- it allows long commands for a single commandline entry to be nicely spaced out onto several lines, as above. The problem is that there is no '\' in the '-algopt' line-- which means that the 3dTrackID command ends at the end of that line (-> the continuation prompt is missing). Therefore, 3dTrackID doesn't know what your '-prefix' should be. So, I think putting a '\' at the end of the algopt line should sort that out.
NB: be careful not to let any spaces or tabs go to the right of the '\' character, or it won't continue (not a problem above, likely, but just a warning for future use)-- I get stung by this everyonceinawhile.
And yes, you will want to add '-logic AND' to your command.
Glad 1dDW_Grad_o_Mat was useful.
--pt