If you read the following post:
You will see that I am having trouble with a strategy requiring the ability to reverse when a condition is met, but I currently only have enough margin to cover 2 contracts. Apparently a true reversal requires 3 contracts.
So if I am going long and I need to reverse to go short, I am currently using the EnterShort() command. This works to close the long position and open a new short position, but as I said it requires 3 contracts to do so.
So it looks like I need to find the most time sensitive way to close the open position, wait until it is actually closed and then submit my new position. The problem I can see right now would be the fact that the OnBarUpdate() only runs once the bar has closed, so if I close a position upon one bar closing, I can't wait until the next bar closes to make sure the position is flat and then open a new reversed position.
Please keep in mind that I am not a C# programmer, but I can usually understand what the code is doing by reading it.
I am wondering how I can have my strategy close the position, wait until we receive the "close position filled" response from the broker and then submit the reverse market order. All without waiting for the bar to close. I also want to keep "CalculateOnBarClose" set to true.
Thank you,
insomniac
Comment