ThisTrade is valid or not when the trade was entered or not. It has nothing to do with pending or trade mode, but with market hours or lookback periods. Please read about enterLong in the manual, and read also the troubleshooting page. There you can learn to see what your script is doing - it will make life much easier when you're not helpless in such a situation.