Hi, I am testing an OMA algo (please see the screenshot below), which needs to use updated working qty of the algo attached order when the order is partially filled, changed size by user or deleted. I used the "wrk qty" in Single Order Container, and export that value to test if it works and got the following issue.
For example, I have one 30 order, when I attach the algo, the algo can export the value of 30 in Parent Order book, which is right, and when I change size or delete the order, the exported value all show the correct value.
However, when the order is partially filled (for example, 3 lots has been filled), and for some reason, I delete the algo and re-attach it, the algo still shows a wrk qty value of 30. The correct value should be 27. In other works, when I attach this algo to some previously partially filled algo, the exported value shows the original full size of the order, not the current existing order size.
I don't know why is that. Basically I need to get the updated value of current working logic no matter the order is partially/fully filled, deleted, or shaved by myself. Can anyone please help me if you know how to get that.
Thank you very much.
Answer by Damon · Apr 12 at 07:40 PM
You are trying to reference the Working Qty of all your manual orders from the Single Order Container Block. You also want to see the updated Working Qty of your original manual order no matter if you Deleted OMA algo, change the Manual order Qty, or have Partial FIlls.
If you Delete the OMA algo from the original manual order..... an NEW attached OMA algo will reflect the manual order qty as seen upon it being attached.
If you change the Qty of the Manual order, or want to account for Partial Fills of the Manual order...... You need to use the Multiplexer Block to account for the Change, Delete, or Fill messages and have a Value Extractor Block reference the "Working Qty" from the drop down menu in the Message Field inside the Formula Window.