{"id":5454,"date":"2024-07-23T13:05:36","date_gmt":"2024-07-23T12:05:36","guid":{"rendered":"https:\/\/pjsmith.me.uk\/?post_type=docs&#038;p=5454"},"modified":"2026-03-12T13:28:35","modified_gmt":"2026-03-12T13:28:35","slug":"algo-bars","status":"publish","type":"docs","link":"https:\/\/pjsmith.me.uk\/index.php\/docs\/pjsprofilebars\/general-feature-notes\/algo-bars\/","title":{"rendered":"Algo bars"},"content":{"rendered":"\n<p>Algo bars are an innovative feature that allows you to write your own alerts and signals, without coding, compiling, etc.<\/p>\n\n\n\n<p>Below, you can see one set of example conditions for a signal<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-3.png\"><img loading=\"lazy\" decoding=\"async\" width=\"589\" height=\"403\" data-attachment-id=\"5455\" data-permalink=\"https:\/\/pjsmith.me.uk\/index.php\/docs\/pjsprofilebars\/general-feature-notes\/algo-bars\/image-18\/\" data-orig-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-3.png\" data-orig-size=\"589,403\" 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\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-3-300x205.png\" data-large-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-3.png\" src=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-3.png\" alt=\"\" class=\"wp-image-5455\" srcset=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-3.png 589w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-3-300x205.png 300w\" sizes=\"auto, (max-width: 589px) 100vw, 589px\" \/><\/a><\/figure>\n\n\n\n<p><strong>Enable<\/strong><br \/>Globally enables or disables the signal<\/p>\n\n\n\n<p>The chart marker option places the text in the Signal name field onto the chart as a native Ninjatrader test object (for interaction with third-party tools), above or below the bar, as set in the options.<\/p>\n\n\n\n<p><strong>Condition #x<\/strong><br \/>Conditions are the criteria you want to match for the signal to be generated. All signals must be true for the event to trigger.<br \/><br \/>Comparison conditions typically consist of 3 or more parts (depending on the comparison).<br \/>A variable name or other value, a comparison operator, and a variable name or value.<br \/>There must be 1 (or more) spaces between the condition parts. For example<br \/><br \/>VOLUME &gt; 500<br \/><br \/>Some logical comparitors, such as &amp;&amp; and ||, are also supported and can be combined if needed. <br \/>More than 1 term can be joined with either &#8216;&amp;&amp;&#8217; or &#8216;||&#8217; (AND or OR), for example,<\/p>\n\n\n\n<p>For example<br \/><br \/>VOLUME &gt; 500 &amp;&amp; CLOSE &lt; OPEN<\/p>\n\n\n\n<p>or<\/p>\n\n\n\n<p>CLOSE &gt; OPEN &amp;&amp; CLOSE &gt; VPOC<br \/><br \/>The full list of supported location operators is &nbsp;&#8220;&gt;&#8221;, &#8220;&lt;&#8220;, &#8220;&gt;=&#8221;, &#8220;&lt;=&#8221;, &#8220;==&#8221;, &#8220;!=&#8221;, &#8220;~~&#8221;, where ~~ means &#8216;close enough&#8217;. It is an approximate rather than an exact match<br \/><br \/>The &#8217;26 release added support for some simple arithmetic operations such as &#8220;\/&#8221;, &#8220;*&#8221;, &#8220;+&#8221;, &#8220;-&#8220;.<br \/>For example<br \/><br \/>CLOSE &gt; OPEN + 5<br \/><br \/>In addition, parentheses for evaluation order are now supported, so it is possible to use them either to force evaluation order or for clarity<\/p>\n\n\n\n<p>(CLOSE \/ OPEN) &gt; 0.05<br \/><br \/>At the time of writing this document, the following variable names are supported (This list was significantly updated for the &#8217;26 release)<\/p>\n\n\n\n<p>CLOSE<br \/>DELTA<br \/>DELTACUM (multibar delta if enabled, else 0)<br \/>DELTAB0 (0-4 &#8211; Delta buckets, if enabled)<br \/>DELTARANK<br \/>DELTAPERCENT<br \/>VOLRANK<br \/>SESSIONPOC<br \/>SESSIONVAH<br \/>SESSIONVAL<br \/>SESSIONVWAP<br \/>DURATIONS (bar duration in seconds)<br \/>DURATIONMS<br \/>OBV<br \/>VPOC (bar vpoc)<br \/>VAH (bar vah)<br \/>VAL (bar val)<br \/>DPOC (bar delta poc)<br \/>ALGOBARSCUSTOMVALUE1 (a customisable value to be used in expressions)<br \/>IMBALANCEUPVOLUME (the bar total imbalance volume)<br \/>IMBALANCEDNVOLUME<br \/>IMBALANCEUPPERCENT (the bar total imbalance %)<br \/>IMBALANCEDNPERCENT<br \/>MAXDELTAATPRICE (the max delta at any single price in the bar)<br \/>HASIMBALANCEUP (returns 1 or 0)<br \/>HASIMBALANCEDN (returns 1 or 0)<br \/>DELTAIMBALANCEPERCENT<br \/>TAILSIZE (the size of the bar tail, in points. Represents the low wick if an up up close, and the high wick if a down close)<br \/>VOLUME<br \/>VOLUMEB0 (0-4 volume buckets if enabled)<br \/>HIGH<br \/>LOW<br \/>OPEN<br \/>VWAPAVG<br \/>VWAP (bar vwap)<br \/>SIGNALSUM (the SUM of &#8216;signals&#8217; triggered on this bar. Bearish signals have a value of -1, bullish 1)<br \/>COTDELTAHIGH<br \/>COTDELTALOW|<br \/>TRMODE (sets &#8216;trend&#8217; or &#8216;regression&#8217; mode)<br \/>TREND1 (1-3 the trend slope values, if enabled)<br \/><br \/>Some values may be queried for historical values in the typical NinjaTrader fashion using BarsAgo<br \/>HIGH[x]LOW[x]OPEN[x]CLOSE[x]VOLUME[x]DELTA[x]OBV[x]DELTARANK[x]VOLRANK[x]VPOC[x]<\/p>\n\n\n\n<p>A special variable is PLOT[x[x]], which can query third-party indicator values via their exposed plots. This plot must be on the same chart as pjsProfilebars and is accessed via the plot name and its barsAgo value, for example. Note &#8211; Ninjatrader itself does not guarantee the order of update of indicators on the chart.<br \/><\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"533\" height=\"118\" data-attachment-id=\"7248\" data-permalink=\"https:\/\/pjsmith.me.uk\/index.php\/docs\/pjsprofilebars\/general-feature-notes\/algo-bars\/image-60\/\" data-orig-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-4.png\" data-orig-size=\"533,118\" 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\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-4-300x66.png\" data-large-file=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-4.png\" src=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-4.png\" alt=\"\" class=\"wp-image-7248\" srcset=\"https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-4.png 533w, https:\/\/pjsmith.me.uk\/wp-content\/uploads\/2024\/07\/image-4-300x66.png 300w\" sizes=\"auto, (max-width: 533px) 100vw, 533px\" \/><\/figure>\n\n\n\n<p><strong>Voice alert<\/strong><br \/>The voice announcement you want when the criteria is met, at the close of bar<\/p>\n\n\n\n<p><strong>Audio alert<\/strong><br \/>The custom audio alert you want (.wav file) played when the criteria is met, at the close of bar<\/p>\n\n\n\n<p><strong>Chart marker<\/strong><br \/>If checked, the signal name will be printed on the chart. This option uses a native text object (so that third-party indicators can also read it), so it may affect performance if you are generating thousands of them.<\/p>\n\n\n\n<p><strong>Chart marker brush<\/strong><br \/>Custom colouring for the chart markers<\/p>\n\n\n\n<p>Above bar?<br \/>You have the choice of placing any chart market above or below the bar<\/p>\n\n\n\n<p><strong>Paint bar<\/strong><br \/>Will paint the body of the bar where the signal is generated<\/p>\n\n\n\n<p><strong>Paint background<\/strong><br \/>Will colour the background of the chart on the bar where the signal is generated<\/p>\n\n\n\n<p><strong>Signal name<\/strong><br \/>This is the custom signal name you give to this set of criteria<\/p>\n\n\n\n<p><strong>Take trade<\/strong> (buy &amp; sell)<br \/>These options will trigger trades, but only if you have the algo helper enabled and armed. The <a href=\"https:\/\/pjsmith.me.uk\/index.php\/docs\/pjsprofilebars\/general-feature-notes\/algo-helper\/\" data-type=\"link\" data-id=\"https:\/\/pjsmith.me.uk\/index.php\/docs\/pjsprofilebars\/general-feature-notes\/algo-helper\/\">algo helper<\/a> enables you to semi-automate your entries or exits based on the trigger of your criteria in the algobars conditions.<\/p>\n\n\n\n<p>This list has been updated since it was originally written with newly supported terms from new releases.<\/p>\n\n\n\n<p>Nice examples and advice are often shared in the Discord.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"featured_media":0,"parent":5388,"menu_order":1,"comment_status":"open","ping_status":"closed","template":"","doc_tag":[],"class_list":["post-5454","docs","type-docs","status-publish"],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"comment_count":0,"_links":{"self":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/docs\/5454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/types\/docs"}],"replies":[{"embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=5454"}],"version-history":[{"count":9,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/docs\/5454\/revisions"}],"predecessor-version":[{"id":7586,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/docs\/5454\/revisions\/7586"}],"up":[{"embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/docs\/5388"}],"next":[{"title":"Algo helper","link":"https:\/\/pjsmith.me.uk\/index.php\/docs\/pjsprofilebars\/general-feature-notes\/algo-helper\/","href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/docs\/7253"}],"prev":[{"title":"Alerts","link":"https:\/\/pjsmith.me.uk\/index.php\/docs\/pjsprofilebars\/general-feature-notes\/alerts\/","href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/docs\/7228"}],"wp:attachment":[{"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=5454"}],"wp:term":[{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/pjsmith.me.uk\/index.php\/wp-json\/wp\/v2\/doc_tag?post=5454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}