I have a simple script I'm trying to use as a trailing stop loss. It has worked in the past.
My problem is, seemingly at random, I'll get an error message stating "rec usage is not allowed in this context". Twice now, I've built this study from scratch, testing to see if the order will pass with each change and it'll work, but then it seems as if it just decides it doesn't want to work anymore.
For example, I set the order up last night and it worked perfectly this morning. When I tied to setup my next order, I get the error message. What am I dong wrong? I'm stumped