1. A crossover happens so ShortCondition is turned on and a Limit order is placed at Value1
2. Value1 is reached so now we're short. ShortCondition is turned off because MP<0
3. The market goes away from you and you're stopped out
4. You turn OFF the strategy for whatever reason (I do daily platform restarts)
5. You turn the strategy back on. MP=0 and the crossover is logged so ShortCondition is now true again.
6. An order is reentered at an already used Value1 price -- which is exactly what I do not want.
No doubt your full process is more complex than your example. So, there are some unknowns that may make the solution more involved.
I haven't tried this but couldn't you maintain an Arw object and update its Date/Time/Price/Direction/Optional Text etc.
only if your SL is hit (and/or PT)? That would continually move it forward every time a new signal's position is closed.
Then, after the restart, you could get the Arw's details and compare them with the latest signal generated. e.g. If they're the same Date/Time/Bar/Value 1 Price (or whatever), then you already opened and closed the position generated by this signal. If it's older, you didn't.
You don't mention whether you ever perform your daily platform restarts if you still have a filled order and working SL/PT but, if you do, then you might also have to turn the assign the market position at broker on or add a check for it (in the once/begin section) and set a flag to reference later in your code snippet to avoid sending a second, duplicate order.