{"id":5411,"date":"2025-12-09T15:50:49","date_gmt":"2025-12-09T21:50:49","guid":{"rendered":"https:\/\/librarytestdev.wpenginepowered.com\/?post_type=doc&#038;p=5411"},"modified":"2026-01-06T19:49:18","modified_gmt":"2026-01-07T01:49:18","slug":"correctly-sequencing-discrete-events","status":"publish","type":"doc","link":"https:\/\/library-staging.tradingtechnologies.com\/adl\/adl-overview\/advanced-concepts\/task\/correctly-sequencing-discrete-events\/","title":{"rendered":"Correctly Sequencing Discrete Events"},"content":{"rendered":"\n<!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n     <!-- in source YML header, should also match the filename\/url -->\n       \n        \n\n        \n      \n          \n      \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file-->\n\n  \n    \n\n\n\n\n\n\n\n\n\n\n            <p>Although it is possible to connect more than one edge to the discrete output port of a given block, it is not advisable.  For example, consider the following ADL algo.\n<\/p>\n\n<p><img decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/library-staging.tradingtechnologies.com\/wp-content\/uploads\/2025\/12\/ac-event-sequencing-base-algo.png\"> \n<\/p>\n\n<p>Upon the first fill, if the path to the <b>MsgInfoExtractor0<\/b> block is executed first followed by the path to the <b>MsgInfoExtractor1<\/b> block, the output of the <b>ValueExtractor0<\/b> block will equal the value of the output of the <b>MsgInfoExtractor0<\/b> block since the value of the <b>MsgInfoExtractor1<\/b> block will be zero.  <\/p>\n    \n    <p>However, upon the first fill, if the path to the <b>MsgInfoExtractor1<\/b> block is executed first followed by the path to the <b>MsgInfoExtractor0<\/b> block, the output of the <b>ValueExtractor0<\/b> block will equal the value of the output of the <b>MsgInfoExtractor0<\/b> block plus the value of the output of the <b>MsgInfoExtractor1<\/b> block.  The actual path that is chosen first by the Algo Server execution logic is not always deterministic.\n<\/p>\n\n<p>To force a deterministic path of execution, simply insert a <b>Sequence<\/b> block immediately downstream of the discrete output port and choose the sequence that makes sense for your algo.  For example, consider this modified algo:\n<\/p>\n\n<p><img decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/library-staging.tradingtechnologies.com\/wp-content\/uploads\/2025\/12\/ac-event-sequencing-correct.png\"> \n<\/p>\n\n<p>Notice now that the path to the <b>MsgInfoExtractor1<\/b> block will always be executed first followed by the path to the <b>MsgInfoExtractor0<\/b> block.  As such, upon the first fill, the output of the <b>ValueExtractor0<\/b> block will equal the value of the output of the <b>MsgInfoExtractor0<\/b> block plus the value of the output of the <b>MsgInfoExtractor1<\/b> block, which is what was intended.\n<\/p>\n","protected":false},"excerpt":{"rendered":"<p><!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p>     <!-- in source YML header, should also match the filename\/url --><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p> <!-- pages using refernce-tab-list layout will not trigger this condition. The Heading will be set in that layout file--><\/p>\n<p>Although it is possible to connect more than one edge to the discrete output port of a given block, it is not advisable.  For example, consider the following ADL algo.\n<\/p>\n<p><img decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/library-staging.tradingtechnologies.com\/wp-content\/uploads\/2025\/12\/ac-event-sequencing-base-algo.png\">\n<\/p>\n<p>Upon the first fill, if the path to the <b>MsgInfoExtractor0<\/b> block is executed first followed by the path to the <b>MsgInfoExtractor1<\/b> block, the output of the <b>ValueExtractor0<\/b> block will equal the value of the output of the <b>MsgInfoExtractor0<\/b> block since the value of the <b>MsgInfoExtractor1<\/b> block will be zero.  <\/p>\n<p>However, upon the first fill, if the path to the <b>MsgInfoExtractor1<\/b> block is executed first followed by the path to the <b>MsgInfoExtractor0<\/b> block, the output of the <b>ValueExtractor0<\/b> block will equal the value of the output of the <b>MsgInfoExtractor0<\/b> block plus the value of the output of the <b>MsgInfoExtractor1<\/b> block.  The actual path that is chosen first by the Algo Server execution logic is not always deterministic.\n<\/p>\n<p>To force a deterministic path of execution, simply insert a <b>Sequence<\/b> block immediately downstream of the discrete output port and choose the sequence that makes sense for your algo.  For example, consider this modified algo:\n<\/p>\n<p><img decoding=\"async\" class=\"img-responsive\" src=\"https:\/\/library-staging.tradingtechnologies.com\/wp-content\/uploads\/2025\/12\/ac-event-sequencing-correct.png\">\n<\/p>\n<p>Notice now that the path to the <b>MsgInfoExtractor1<\/b> block will always be executed first followed by the path to the <b>MsgInfoExtractor0<\/b> block.  As such, upon the first fill, the output of the <b>ValueExtractor0<\/b> block will equal the value of the output of the <b>MsgInfoExtractor0<\/b> block plus the value of the output of the <b>MsgInfoExtractor1<\/b> block, which is what was intended.<\/p>\n","protected":false},"author":2,"template":"","meta":{"_acf_changed":false,"footnotes":""},"docs-category":[219],"class_list":["post-5411","doc","type-doc","status-publish","hentry","docs-category-task"],"acf":[],"_links":{"self":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/5411","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc"}],"about":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/types\/doc"}],"author":[{"embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/users\/2"}],"version-history":[{"count":0,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/doc\/5411\/revisions"}],"wp:attachment":[{"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/media?parent=5411"}],"wp:term":[{"taxonomy":"docs-category","embeddable":true,"href":"https:\/\/library-staging.tradingtechnologies.com\/ja\/wp-json\/wp\/v2\/docs-category?post=5411"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}