{"id":1304,"date":"2016-01-17T00:01:57","date_gmt":"2016-01-16T23:01:57","guid":{"rendered":"http:\/\/www.amibroker.com\/kb\/?p=1304"},"modified":"2016-01-29T00:05:13","modified_gmt":"2016-01-28T23:05:13","slug":"adding-custom-grid-levels-to-rsi-indicator","status":"publish","type":"post","link":"https:\/\/www.amibroker.com\/wordpress\/kb\/2016\/01\/17\/adding-custom-grid-levels-to-rsi-indicator\/","title":{"rendered":"Adding custom grid levels to RSI indicator"},"content":{"rendered":"

Built-in RSI indicator offers the ability to display one of predefined grid levels to indicate oversold and overbought regions. This can be done in Axes&Grid<\/strong> tab of Parameters<\/strong> window available under right-mouse button.<\/p>

\"Grid<\/p>

If we require more flexibility, then as an alternative, we could modify the code and call PlotGrid function to display the custom grid lines. This allows to specify any level for the grids. A modified formula is presented below:<\/p>SetChartOptions<\/span>( <\/span>0<\/span>, <\/span>chartShowArrows<\/span>, <\/span>0 <\/span>);
<\/span>periods <\/span>= <\/span>Param<\/span>( <\/span>"Periods"<\/span>, <\/span>15<\/span>, <\/span>1<\/span>, <\/span>200<\/span>, <\/span>1 <\/span>);
<\/span>oversold <\/span>= <\/span>Param<\/span>( <\/span>"Oversold level"<\/span>, <\/span>15<\/span>, <\/span>1<\/span>, <\/span>100<\/span>, <\/span>1 <\/span>);
<\/span>overbought <\/span>= <\/span>Param<\/span>( <\/span>"Overbought level"<\/span>, <\/span>85<\/span>, <\/span>1<\/span>, <\/span>100<\/span>, <\/span>1 <\/span>);

<\/span>Plot<\/span>( <\/span>RSI<\/span>( <\/span>periods<\/span>), <\/span>_DEFAULT_NAME<\/span>(), <\/span>ParamColor<\/span>( <\/span>"Color"<\/span>, <\/span>colorCycle <\/span>), <\/span>ParamStyle<\/span>(<\/span>"Style"<\/span>)  );
<\/span>PlotGrid<\/span>( <\/span>oversold <\/span>);
<\/span>PlotGrid<\/span>( <\/span>overbought <\/span>)<\/code>

\"Param<\/p>

Now, since the formula uses Param<\/a> function as input, the custom grid levels can be defined and modified in Parameters<\/strong> tab. <\/p>","protected":false},"excerpt":{"rendered":"

Built-in RSI indicator offers the ability to display one of predefined grid levels to indicate oversold and overbought regions. This can be done in Axes&Grid tab of Parameters window available under right-mouse button.If we require more flexibility, then as an alternative, we could modify the code and call PlotGrid function to display the custom grid […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[3],"tags":[],"_links":{"self":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/1304"}],"collection":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/comments?post=1304"}],"version-history":[{"count":1,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/1304\/revisions"}],"predecessor-version":[{"id":1307,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/posts\/1304\/revisions\/1307"}],"wp:attachment":[{"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/media?parent=1304"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/categories?post=1304"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.amibroker.com\/wordpress\/kb\/wp-json\/wp\/v2\/tags?post=1304"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}