3.17.21 2:00 pm EST
I discovered the problem. It was my lack of understanding of how an order object is processed during high-volume environments.
The error was mine in that the logic was wrong due to my ignorance.
My script was working in backtesting and pretty much any other time than 9:30 am at the open. Due to increased volume at the open, the logic used, and the script being set to calculate OnPriceChange, the increased volume was causing my logic to process faster than NT could acknowledge that a variable has been assigned a new value that was needed to set my exit levels.
The script has 3 separate steps that need to be completed in order, and each of them must be complete before the logic progresses to the next step.
At the open, the price is changing so quickly that based on how the script was written the 2nd and 3rd steps were occurring almost simultaneously before a value could be assigned and then referenced to set the exits.
I separated the 2nd and 3rd step with an additional 1 second and the script is working beautifully.
end edit
Hello,
I am using Advanced Order Handling and I have a functioning ES strategy that places a long market order, then successfully submits the stop and target limit orders. I do not have any problems with this script.
I attempted to create a separate duplicate strategy that places a short market order instead of a long market order that then submits the exit orders.
I have reversed the logic so that the stop order from the long strategy is no longer below the entry and so the target is not above the short entry.
On the short script I am getting an immediate buy to cover market order that closes the position.
The following is the trace I am getting for the exit.
Entered internal SubmitOrderManaged() method...: BarsInProgress=0 Action=BuyToCover OrderType=Market Quantity=0 LimitPrice=0 StopPrice=0 SignalName=" FromEntrySignal"
All of the values are zeros, and my SignalName from the market order entry is not referenced. I cannot figure out where the Buy To Cover order is coming from.
I have added to prints to the script to attempt to find the issue, but the logic is flowing properly through the Advanced Order Handling sequence.
This is the only trace appearing - no errors are printed in the output or being logged.
Does this sound familiar to anyone? I am hoping that this sounds familiar to someone and they might have some thoughts on it.
Thank you for any help!
Comment