Alright, the problem I'm seeing definitely seems to be somewhere in the Trailing Stop Update section of the script. I commented it out, and inserted the trailing stop code from another script, and it worked just fine. Lost money, but it didn't give the error, "invalid S/L or T/S," like it was before. I'm trying to understand the Trailing Stop Update code to figure out what might cause the error.