{"id":4483,"date":"2023-12-19T10:32:38","date_gmt":"2023-12-19T10:32:38","guid":{"rendered":"https:\/\/pjsmith.me.uk\/?p=4483"},"modified":"2023-12-19T10:32:41","modified_gmt":"2023-12-19T10:32:41","slug":"stacked-imbalances-do-they-stack-up","status":"publish","type":"post","link":"https:\/\/pjsmith.me.uk\/index.php\/2023\/12\/stacked-imbalances-do-they-stack-up\/","title":{"rendered":"Stacked imbalances &#8211; Do they stack up?"},"content":{"rendered":"<h2><strong>Stacked imbalances &#8211; Do they stack up?<\/strong><\/h2>\n<p>Pun, intended&#8230;<\/p>\n<p>So, order-flow stacked imbalances. Every YouTube video and furu currently seems to be talking about them. Do they stack up?<\/p>\n<p>Before we begin. This is order flow-related material. If you are a bare candle fanatic, that&#8217;s fine &#8211; Just skip this entire article! I promise I will not hold it against you.<\/p>\n<p>So, what IS a stacked imbalance? Well, it&#8217;s typically an overwhelming amount of volume driven by buyers or sellers in one direction, usually, quickly. It is basically a shotgun that tends to clear a path in a certain direction. Here is an example of one highlighted, up close, using a ladder view. Note the bright green numbers stacked on top of each other on the buy side &#8211; hence the name. Simple, right? You&#8217;ll note there is typically little volume on the sell side &#8211; This happens when a large amount of orders on one side tends to sweep the book quickly &#8211; no one gets a chance to execute anything else!<\/p>\n<p><a href=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_sS84TygvCr.webp\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4489\" data-permalink=\"https:\/\/pjsmith.me.uk\/index.php\/2023\/12\/stacked-imbalances-do-they-stack-up\/ninjatrader_ss84tygvcr\/\" data-orig-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_sS84TygvCr.webp\" data-orig-size=\"365,238\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NinjaTrader_sS84TygvCr\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_sS84TygvCr-300x196.webp\" data-large-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_sS84TygvCr.webp\" class=\"alignnone wp-image-4489 size-medium\" src=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_sS84TygvCr-300x196.webp\" alt=\"Stacked imbalance shown on the order flow ladder\" width=\"300\" height=\"196\" srcset=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_sS84TygvCr-300x196.webp 300w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_sS84TygvCr.webp 365w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>I recently added some new options to my <a href=\"https:\/\/pjsmith.me.uk\/index.php\/2021\/02\/pjsprofilebars-indicator-for-ninjatrader-8\/\" data-type=\"post\" data-id=\"1666\">pjsProfileBars<\/a> indicator, for Ninjatrader 8. Whilst imbalances were already detected and highlighted, I decided to improve that functionality. I also added &#8216;stacked&#8217; imbalance detection with a range of parameters for filtering those imbalances. And, what better way to get some statistics on these setups, than to add trigger support to the algo helper so I can automate some backtesting \ud83d\ude42<\/p>\n<p>Here is a screenshot of the latest development build in testing<\/p>\n<figure class=\"wp-block-image size-large\"><\/figure>\n<p><a href=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH.webp\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4488\" data-permalink=\"https:\/\/pjsmith.me.uk\/index.php\/2023\/12\/stacked-imbalances-do-they-stack-up\/ninjatrader_cedyq0w0uh\/\" data-orig-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH.webp\" data-orig-size=\"1638,750\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NinjaTrader_ceDyq0w0uH\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH-300x137.webp\" data-large-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH-1024x469.webp\" class=\"alignnone wp-image-4488 size-large\" src=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH-1024x469.webp\" alt=\"\" width=\"1024\" height=\"469\" srcset=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH-1024x469.webp 1024w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH-300x137.webp 300w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH-768x352.webp 768w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH-1536x703.webp 1536w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH-600x275.webp 600w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_ceDyq0w0uH.webp 1638w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/a><\/p>\n<p>The algo helper is the button row across the top left of the screen that allows you to set various long\/short triggers on different signals to automatically trigger trade entries.<\/p>\n<p>So what did we test? I set some parameters for the amount of volume, number of imbalances, tolerances, etc., with a single contract using a fixed ATM 80 tick profit, 92 tick stop (just under 1:1). This was an arbitrary choice. I thought it would be close enough to work. The test is run on the Nasdaq in tick replay. This gives as close to real-life as is possible with Ninjatrader (and tests the software!). I chose to trade longs only, because this type of setup is typically a trend-following setup (it can also be regression, but not finished coding that yet!), and, well &#8211; Nasdaq is certainly in an uptrend at the moment. I let every trade execute from stop to target, without any manual intervention. Trades were only closed when the target or stop was hit.<\/p>\n<p>Here are the results for the last week<\/p>\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/9Dx9XdBIM9.webp\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4491\" data-permalink=\"https:\/\/pjsmith.me.uk\/index.php\/2023\/12\/stacked-imbalances-do-they-stack-up\/9dx9xdbim9\/\" data-orig-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/9Dx9XdBIM9.webp\" data-orig-size=\"495,889\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"9Dx9XdBIM9\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/9Dx9XdBIM9-167x300.webp\" data-large-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/9Dx9XdBIM9.webp\" class=\"alignnone wp-image-4491 size-full\" src=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/9Dx9XdBIM9.webp\" alt=\"ninjatrader performance results\" width=\"495\" height=\"889\" srcset=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/9Dx9XdBIM9.webp 495w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/9Dx9XdBIM9-167x300.webp 167w\" sizes=\"auto, (max-width: 495px) 100vw, 495px\" \/><\/a><\/figure>\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_YNQrQ6DnQ1.webp\"><img loading=\"lazy\" decoding=\"async\" data-attachment-id=\"4490\" data-permalink=\"https:\/\/pjsmith.me.uk\/index.php\/2023\/12\/stacked-imbalances-do-they-stack-up\/ninjatrader_ynqrq6dnq1\/\" data-orig-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_YNQrQ6DnQ1.webp\" data-orig-size=\"1016,674\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"NinjaTrader_YNQrQ6DnQ1\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_YNQrQ6DnQ1-300x199.webp\" data-large-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_YNQrQ6DnQ1.webp\" class=\"alignnone wp-image-4490 size-full\" src=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_YNQrQ6DnQ1.webp\" alt=\"\" width=\"1016\" height=\"674\" srcset=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_YNQrQ6DnQ1.webp 1016w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_YNQrQ6DnQ1-300x199.webp 300w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_YNQrQ6DnQ1-768x509.webp 768w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_YNQrQ6DnQ1-600x398.webp 600w\" sizes=\"auto, (max-width: 1016px) 100vw, 1016px\" \/><\/a><a href=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/image-3.png\"><img decoding=\"async\" data-attachment-id=\"4477\" data-permalink=\"https:\/\/pjsmith.me.uk\/image-3-4\/\" data-orig-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/image-3.png\" data-orig-size=\"1016,674\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"image-3\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/image-3-300x199.png\" data-large-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/image-3.png\" class=\"wp-image-4477\" src=\"file:\/\/\/C:\/Users\/Paulhome\/.config\/joplin-desktop\/resources\/1ca3ae11b5f04067bf62ec47ca169c95.png\" alt=\"\" \/><\/a><\/figure>\n<p>Conclusion &#8211; Small test, but encouraging! Certainly better than the majority of the first attempt, simplified backtests I do. Lots more testing on both code and results to do, but I would certainly say these are something to pay attention to. Additional filters for when price is at the top or bottom of a swing etc., will certainly be worth looking into, though for the most part, the algo functions in the app used here are not intended for full auto use! This strategy would almost certainly enhance other strategies as an additional criterion or weight for entry.<\/p>\n<p>Do you trade these? Do you have any comments regarding implementation in the software? I would love to hear your feedback.<\/p>\n<p>Merry Christamas all.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Stacked imbalances &#8211; Do they stack up? Pun, intended&#8230; So, order-flow stacked imbalances. Every YouTube video and furu currently seems to be talking about them. Do they stack up? Before&#8230;<\/p>\n","protected":false},"author":1,"featured_media":4489,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[89,72,91,57],"tags":[75,44,109,55],"class_list":{"0":"post-4483","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-indicators","8":"category-ninjatrader","9":"category-studies","10":"category-trading","11":"tag-indicators","12":"tag-ninjatrader","13":"tag-order-flow-2","14":"tag-scalping"},"jetpack_featured_media_url":"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2023\/12\/NinjaTrader_sS84TygvCr.webp","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/4483","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=4483"}],"version-history":[{"count":0,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/4483\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/media\/4489"}],"wp:attachment":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=4483"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=4483"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=4483"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}