{"id":111444,"date":"2018-04-01T18:22:39","date_gmt":"2018-04-01T18:22:39","guid":{"rendered":"http:\/\/www.timestored.com\/b\/?p=111444"},"modified":"2018-04-01T18:29:14","modified_gmt":"2018-04-01T18:29:14","slug":"qstudio-dot-graph-rendering-fix-order-status","status":"publish","type":"post","link":"https:\/\/www.timestored.com\/b\/qstudio-dot-graph-rendering-fix-order-status\/","title":{"rendered":"qStudio Dot Graph Rendering of FIX Order Status"},"content":{"rendered":"<p>&#8220;The Financial Information eXchange (<a href=\"https:\/\/en.wikipedia.org\/wiki\/Financial_Information_eXchange\">FIX<\/a>) protocol is an electronic communications protocol initiated in 1992 for international real-time exchange of information related to the securities transactions and markets.&#8221;. You can see an example of a FIX message being parsed <a href=\"https:\/\/fixparser.targetcompid.com\/\">here<\/a>.<\/p>\n<p>What we care about is that an order goes through a lifecycle. From newly created to filled or removed. Anything that involves state-transitions or a lifecycle can be visualized as a graph. A graph depicts transitions from one state to another. Often SQL tables record every transition of that state. This can then be summarised into a count of the last state, giving something like the following:<\/p>\n<table class=\"table table-bordered table-hover table-condensed\">\n<\/thead>\n<tr>\n<th>From<\/th>\n<th>To<\/th>\n<th>label<\/th>\n<th>cnt<\/th>\n<\/tr>\n<tr>\n<td>PendingCancel<\/td>\n<td>Calculated<\/td>\n<td>Rejected<\/td>\n<td>50<\/td>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<tr>\n<td>PendingReplace<\/td>\n<td>Calculated<\/td>\n<td>Rejected<\/td>\n<td>10<\/td>\n<\/tr>\n<tr>\n<td>PendingReplace<\/td>\n<td>Calculated<\/td>\n<td>Replaced<\/td>\n<td>40<\/td>\n<\/tr>\n<tr>\n<td>Calculated<\/td>\n<td>PendingReplace<\/td>\n<td>PendingReplace<\/td>\n<td>50<\/td>\n<\/tr>\n<tr>\n<td>Calculated<\/td>\n<td>Filled<\/td>\n<td>Trade<\/td>\n<td>9400<\/td>\n<\/tr>\n<tr>\n<td>Calculated<\/td>\n<td>Calculated<\/td>\n<td>Trade<\/td>\n<td>5239<\/td>\n<\/tr>\n<tr>\n<td>PendingCancel<\/td>\n<td>Removed<\/td>\n<td>Cancelled<\/td>\n<td>150<\/td>\n<\/tr>\n<tr>\n<td>Calculated<\/td>\n<td>PendingCancel<\/td>\n<td>PendingCancel<\/td>\n<td>200<\/td>\n<\/tr>\n<tr>\n<td>New<\/td>\n<td>Calculated<\/td>\n<td>Calculated<\/td>\n<td>9660<\/td>\n<\/tr>\n<tr>\n<td>New<\/td>\n<td>Removed<\/td>\n<td>Rejected<\/td>\n<td>140<\/td>\n<\/tr>\n<tr>\n<td>Created<\/td>\n<td>Removed<\/td>\n<td>Rejected<\/td>\n<td>300<\/td>\n<\/tr>\n<tr>\n<td>Created<\/td>\n<td>New<\/td>\n<td>New<\/td>\n<td>9800<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>qStudio now automatically converts this result table to <a href=\"https:\/\/en.wikipedia.org\/wiki\/DOT_(graph_description_language)\">DOT<\/a> format and if you have <a href=\"http:\/\/<a href=\"https:\/\/www.graphviz.org\/download\/\">graphviz<\/a>&#8220;>graphviz installed<\/a> and on the PATH, will generate the following:<\/p>\n<p><a href=\"https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/fix-lifecycle.png\"><img loading=\"lazy\" src=\"https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/fix-lifecycle.png\" alt=\"\" width=\"849\" height=\"407\" class=\"alignnone size-full wp-image-111446\" srcset=\"https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/fix-lifecycle.png 849w, https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/fix-lifecycle-300x144.png 300w, https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/fix-lifecycle-768x368.png 768w\" sizes=\"(max-width: 849px) 100vw, 849px\" \/><\/a><\/p>\n<p>Note I did tweak the table a little to add styling like so:<\/p>\n<p><code>update style:(`Filled`Removed!(\"color=green\";\"color=red\")) To,label:(label,'\" \",\/:cnt) from currentFixStatus<\/code><\/p>\n<p>The format is detailed again in our <a href=\"http:\/\/www.timestored.com\/qstudio\/help\/chart-examples#dot-graph\">qStudio Chart Data Format<\/a> page.<\/p>\n<p>This is another even simpler example:<\/p>\n<p><a href=\"https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/qstudio-dot-graph.png\"><img loading=\"lazy\" src=\"https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/qstudio-dot-graph.png\" alt=\"\" width=\"837\" height=\"828\" class=\"alignnone size-full wp-image-111449\" srcset=\"https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/qstudio-dot-graph.png 837w, https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/qstudio-dot-graph-300x297.png 300w, https:\/\/www.timestored.com\/b\/wp-content\/uploads\/2018\/04\/qstudio-dot-graph-768x760.png 768w\" sizes=\"(max-width: 837px) 100vw, 837px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;The Financial Information eXchange (FIX) protocol is an electronic communications protocol initiated in 1992 for international real-time exchange of information related to the securities transactions and markets.&#8221;. You can see an example of a FIX message being parsed here. What we care about is that an order goes through a lifecycle. From newly created to [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0},"categories":[2,92],"tags":[],"_links":{"self":[{"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/posts\/111444"}],"collection":[{"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/comments?post=111444"}],"version-history":[{"count":6,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/posts\/111444\/revisions"}],"predecessor-version":[{"id":111452,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/posts\/111444\/revisions\/111452"}],"wp:attachment":[{"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/media?parent=111444"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/categories?post=111444"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.timestored.com\/b\/wp-json\/wp\/v2\/tags?post=111444"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}