I have a strategy code which in most situations performs exactly as expected except for one.
Generally, for isolated trades, it works according to expectation but when one trade is immediately followed by another trade, problems - two entries instead of one - arise.
For example, if I had a long position, a signal occured for me to reverse the position, the code for that would be EnterShort();. Another portion of the code, which helps manage a position triggers a ExitLong() at the same time. The same situation also occurs for short positions.
Is there any way I can avoid a doubling of my position? If so, how do I go about doing that?
Regards
Kay Wai

Comment