The scenario: On day 1 I run SampleMACrossOver, it opens a position (say short), and closes it at the end of the day, because I have ExitOnClose = true set, and I exit 30 sec. before the close. Good so far.
On day 2, I turn back on NT, start the strategy before the beginning of RTH, and it thinks my position never closed, so it thinks I am still short. When the next cross occurs during RTH, it will try to close the nonexistant position, and open a new long.
What is strange is if I stop the strategy and restart it (ONLY after RTH has started - i.e., my chart in in RTH, so it is receiving current data), then the strategy realizes I am flat. If I stop/restart before RTH, it still thinks I am short.
I am not syncing my account positions - and in fact cannot. The strategy should know that I MUST be flat after the close of the old day, and the beginning of a new day if ExitOnClose = true. In fact, when I look at the log output that starts the strategy, it is recognizing I have ExitOnClose = true. It is simply ignoring it for some unfathomable reason.
Please help.
Comment