May 31, 2022

Improvements

Improved concurrency locking when executing trades so that two trade signals for the same broker account and ticker cannot be executed in parallel at the exact same time.

This change should not affect most people. It would only affect you if you are sending duplicate signals at the exact same time.

For example, before this change if you were long 1 contract of NQ and your strategy incorrectly sent 2 exit signals at the exact same time back to back, then both signals would get executed at the same time and they would both try to sell the 1 long contract. Since TradeStation futures don't differentiate between selling to close a long position and selling to open a short position, the 2nd sell order would end up taking you short 1 contract.

After this change, the 1st exit signal would block the 2nd and it will wait until the 1st exit signal is done executing. Then, once the 2nd exit signal executes, there wouldn't be a long position open anymore so no sell order would be sent and the signal would get rejected because the system would calculate that there is nothing to do.

Last updated