" ... After turning on TraceOrders, I think I have began to understand why NinjaTrader does not allow an Exit() immediately followed by a reverse entry on the same tick, which essentially is what is happening if CalculateOnBarClose is true." (new emphasis added)
I think we may have gotten lost in the verbiage, and I accept the blame. It is a simple issue of not always stating all the conditions because I made the assumption that every good trader that I know assumes as near gospel: an unclosed candle means nothing; it only talks when it is closed. Therefore, I always had the unstated assumption that CalculateOnBarClose is true unless I say otherwise. Indeed so does NT, as that is the default for CalculateOnBarClose.
So now as stated above, here is the issue again.
- CalculateOnBarClose is true. (the NT default)
- Position has a protective stop.
Is it or is it not possible to reverse on a single candle?
The solution that you sent me explicitly makes COBC false ab initio. Of course that will work provided one is willing to make the computing resources available. Indeed my own solution, among other things, itself turns COBC temporarily false, then places the reverse order, then turns COBC back to true. (There are other issues that also need handling, to ensure consistency and safety, so there is more to it than just that).
So, I guess as I have not consistently stated the "CalculateOnBarClose = true" condition when I made my statements, my statements are not completely correct.
(noun) a specification of an object, manifested by an agent, intended to accomplish goals, in a particular environment, using a set of primitive components, satisfying a set of requirements, subject to constraints;
(verb, transitive) to create a design, in an environment (where the designer operates)

Comment