{"id":76,"date":"2010-07-02T11:28:22","date_gmt":"2010-07-02T18:28:22","guid":{"rendered":"http:\/\/qclsolutions.com\/home\/?p=76"},"modified":"2010-08-10T22:44:53","modified_gmt":"2010-08-11T05:44:53","slug":"how-do-i-get-intrabar-highs-and-lows-for-my-tradestation-indicator","status":"publish","type":"post","link":"https:\/\/qclsolutions.com\/home\/?p=76","title":{"rendered":"How do I make OHLC bars with my TradeStation indicator?"},"content":{"rendered":"<p>Question: A customer asked, &#8220;How do I make OHLC bars with\u00a0my indicator?&#8221;<\/p>\n<p>Answer: This can be accomplished with real time data. Your indicator needs to track Open, High and Low values with intrabarpersist variables. It also needs to track when the bars of source data streams close. That way your indicator can determine when the opening tick occurs, and when to reset the high and low variables.<\/p>\n<p>Here is an example EasyLanguage indicator, creating bars for (Up Volume &#8211; Down Volume) values:<\/p>\n<p style=\"padding-left: 30px;\">{<br \/>\nDEMO<br \/>\nBy: David O&#8217;Dell<br \/>\n<a href=\"mailto:dodell@QCLsolutions.com\">Support@QCLsolutions.com<\/a><br \/>\n!QCL Solutions<br \/>\nP.O. Box 2304<br \/>\nPalm City, FL 34990<br \/>\n347-746-1725<\/p>\n<p style=\"padding-left: 30px;\">For intraday and tick bars only.<\/p>\n<p style=\"padding-left: 30px;\">.iat MyRTHighLow<br \/>\n}<br \/>\nInput:<br \/>\n\u00a0DataNum(1),<br \/>\n\u00a0AvgLength(50),<br \/>\n\u00a0NumDevs(1),<br \/>\n\u00a0ShowBaseline_ok1(1),<br \/>\n\u00a0Baseline(0);<\/p>\n<p style=\"padding-left: 30px;\">Const: int BogusValue(9999999);<\/p>\n<p style=\"padding-left: 30px;\">Variables:<br \/>\n\u00a0MyValue(0), MyAvgValue(0), MyStDevValue(0),<br \/>\n\u00a0vShowBaseline(ShowBaseline_ok1=1),<br \/>\n\u00a0intrabarpersist Op(BogusValue),<br \/>\n\u00a0intrabarpersist HH(0),<br \/>\n\u00a0intrabarpersist LL(BogusValue),<br \/>\n\u00a0intrabarpersist OnPriorBarClosed(True);<\/p>\n<p style=\"padding-left: 30px;\">MyValue = UpTicks &#8211; DownTicks {example calculation};<br \/>\nMyAvgValue = Average(MyValue, AvgLength);<br \/>\nMyStDevValue = StandardDev(MyValue, AvgLength, 2);<\/p>\n<p style=\"padding-left: 30px;\">if (GetAppInfo(aiRealTimeCalc) = 1) then<br \/>\nbegin<br \/>\n\u00a0if OnPriorBarClosed then<br \/>\n\u00a0begin<br \/>\n\u00a0\u00a0Op = MyValue;<br \/>\n\u00a0\u00a0HH = MyValue;<br \/>\n\u00a0\u00a0LL = MyValue;<br \/>\n\u00a0end<br \/>\n\u00a0else<br \/>\n\u00a0begin<br \/>\n\u00a0\u00a0HH = MaxList(MyValue, HH);<br \/>\n\u00a0\u00a0LL = MinList(MyValue, LL);<br \/>\n\u00a0end;<br \/>\n\u00a0if Op &lt;&gt; BogusValue then<br \/>\n\u00a0\u00a0Plot1(Op, &#8220;RTOpen&#8221;);<br \/>\n\u00a0Plot2(HH, &#8220;RTHigh&#8221;);<br \/>\n\u00a0Plot3(LL, &#8220;RTLow&#8221;);<br \/>\nend;<br \/>\nPlot4(MyValue, &#8220;RTClose&#8221;);<br \/>\nPlot5(MyAvgValue, &#8220;AvgClose&#8221;);<br \/>\nPlot6(MyAvgValue + NumDevs * MyStDevValue, &#8220;UpperBand&#8221;);<br \/>\nPlot7(MyAvgValue &#8211; NumDevs * MyStDevValue, &#8220;LowerBand&#8221;);<\/p>\n<p style=\"padding-left: 30px;\">if ((GetAppInfo(aiApplicationType)=cChart) and vShowBaseline) then<br \/>\n\u00a0Plot11(Baseline, &#8220;Baseline&#8221;);<br \/>\nOnPriorBarClosed = (BarStatus(DataNum) = 2);<\/p>\n<p>\u00a0Note that property settings for this indicator are important.<\/p>\n<form action=\"MAILTO:dodell@QCLsolutions.com\" enctype=\"text\/plain\" method=\"post\"><em>I&#8217;ll email the zipped folder to you. Send the request below.<br \/>\nOr email request directly to <a href=\"mailto:Support@QCLsolutions.com\">Support@QCLsolutions.com<\/a>.<\/em><em><br \/>\n<\/em>Request:<br \/>\n<input name=\"request\" size=\"40\" type=\"text\" value=\"Realtime indicator bars (MyRTHighLow)\" \/><em> <\/em><input type=\"submit\" value=\"Send\" \/><em> <\/em><\/form>\n<p>\u00a0<\/p>\n<p>Regards,<\/p>\n<p>David O&#8217;Dell<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Question: A customer asked, &#8220;How do I make OHLC bars with\u00a0my indicator?&#8221; Answer: This can be accomplished with real time data. Your indicator needs to track Open, High and Low values with intrabarpersist variables. It also needs to track when the bars of source data streams close. That way your indicator can determine when the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=\/wp\/v2\/posts\/76"}],"collection":[{"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=76"}],"version-history":[{"count":14,"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions"}],"predecessor-version":[{"id":127,"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=\/wp\/v2\/posts\/76\/revisions\/127"}],"wp:attachment":[{"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=76"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=76"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/qclsolutions.com\/home\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=76"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}