{"id":1070,"date":"2015-02-09T17:06:06","date_gmt":"2015-02-09T22:06:06","guid":{"rendered":"http:\/\/www.amibroker.com\/kb\/?p=1070"},"modified":"2015-02-11T17:08:39","modified_gmt":"2015-02-11T22:08:39","slug":"how-to-show-date-axis-in-a-newly-created-chart-pane","status":"publish","type":"post","link":"https:\/\/www.amibroker.com\/wordpress\/kb\/2015\/02\/09\/how-to-show-date-axis-in-a-newly-created-chart-pane\/","title":{"rendered":"How to show date axis in a newly created chart pane"},"content":{"rendered":"
When we double-click on the selected indicator in Charts<\/strong> window to display it in a new chart pane or apply our custom code as indicator, by default most of the indicator formulas will not show the date-axis, unless we specified such requirement in our formula.<\/p> In order to display the date axis, we need to click on the chart with the right<\/strong> mouse button, choose Parameters->Axes&Grid<\/strong> tab, then set Show date axis<\/strong> option to YES<\/strong>.<\/p> <\/p> There is also a way to pre-code such condition in our custom indicator formula. To enable data-axis display when we apply the new indicator formula, we just need to add relevant SetChartOptions<\/strong>() function call:<\/p>SetChartOptions<\/span>( <\/span>0<\/span>, <\/span>chartShowDates <\/span>);
<\/span>\/\/ sample custom indicator
<\/span>Plot<\/span>( <\/span>RSI<\/span>(), <\/span>"RSI"<\/span>, <\/span>colorRed <\/span>)<\/code>