Login Page - Create Account

Support Board


Date/Time: Tue, 13 May 2025 21:59:41 +0000



Post From: Flattening position without orders - PT doesnt reset LastFillDateTime nor LastExitDateTime

[2016-05-10 15:57:16]
wat - Posts: 67
Sadly OrderFillCalculatedPosition didnt help us.


Seems like the problem is caused by sierra not getting update on position and portfolio (namely Portfolio Update and Execution Callback) and hence acting on incorrect data (chat with TWS support):

Siteng J: I have been digging in to the log file and here is what I have found:
Siteng J: You originally submitted a buy order at 4311.25 and it was filled, so you entered +5 position, this is correctly sent in the portfolio entry
Siteng J: After around 5 minutes of the execution of the parent, your profit taker was also filled at 4316.25
Siteng J: The corresponding execution report has been triggered
Siteng J: However, before the next portfolio update has been sent out by TWS, I see that Sierra placed another market order to sell 5 NQ, and it was executed immediately
Siteng J: Afterwards, the portfolio entry of -5 was sent back automatically
me: So the problem was caused by the Sierra being quicker than the portfolio update by TWS? How long delay would fix that?
Siteng J: I am not sure what was the strategy used by Sierra Chart and why the market order was sent
Siteng J: It is possible that their strategy rely on the portfolio update call back
Siteng J: But note we are not able to guarantee the there will be a portfolio update for each execution
Siteng J: For example, when several executions take place close to each other, it is possible that only one portfolio update is sent to reflect all changes
Siteng J: But it is guaranteed that there will be an execution details call back sent for each execution
me: I see. This isnt happening every time. So I wonder how long wait time for check "position without orders" would mitigate this issue.
me: In order to reflect the time between order and portfolio update... for example in this case
me: Would, for example, one second be enough to move the flattening order after portfolio update?
Siteng J: Actually I would not suggest you base your strategy on the portfolio update
Siteng J: This is not guaranteed to be sent for each execution or immediately after an execution
Siteng J: I would suggest you monitor the execution call back function directly
me: Thank you. Sadly I am not able to override Sierra behavior so at the moment so I have no direct access to TWS API. Is there any possible way for me to solve this issue beside waiting for any portfolio update?
Siteng J: Unfortunately you would need to contact Sierra Charts and see if they can adjust this for you

We are not able to switch Broker. Since we are unable to monitor API data flow ourselves would some wait time fix the issue with late data update? Or is there any other way to reliably check if we are in position without orders?

Thank you