Indicator chart panel -- how to set graph's upper and lower boundaries?


How to set a specific horizontal lines on an indicator graph chart panel instead of AmiBroker automatically calculating vertical axis numbers based upon the max and min of the graphed data ? For instance, on the CCI indicator I would always like to see the available data graphed with just two horizontal lines ---- +100 and -100 ----- and the entire panel with an upper boundary of +125 and lower boundary of -125, but +125 and -125 will not be printed on the axis.

Example 1:
CCI data ranging from +75 to +173. This data will appear in the upper half of the panel, the data above +125 would appear as a horizontal line riding along the upper boundary of the panel as a ceiling, the lower horizontal line -100 will be present, and the bottom of the chart panel would correspond to -125. Neither the upper nor lower edges of the graph would be marked with +125 / -125.

I am trying to reduce the number of horizontal lines the eye has to navigate through , and also keep the indicator chart consistent from ticker to ticker instead of the software automatically re-sizing the vertical axis around each ticker’s available data



Kevin (knickname “Joe”)


Take a Look at the PLOT statement in the AmiBroker help.

Plot(array, name, color, style, minvalue, maxvalue, Xshift, Zorder, width);

To LIMIT to +125 and -125 put those values in the minvalue, maxvalue.

To show +100 and -100, make your own Plot.

Plot(100, "CCI Upper", colorRed, styleLine); (and similarly for -100).

Hope this helps


Click with RIGHT mouse button over chart, select Parameters, switch to Axes tab and switch Scaling to Custom and enter upper and lower bounds in Min/Max fields. You can change grid there too.

1 Like


The following options are available:

        Automatic - minimum and maximum value of Y axis is determined automatically by AmiBroker
        Custom - minimum and maximum value of Y axis are user-defined
    Minimum - minimum Y axis value (this property is locked if automatic scaling is selected, to unlock choose Custom scaling)
    Maximum - maximum Y axis value (this property is locked if automatic scaling is selected, to unlock choose Custom scaling)
        Linear - use linear Y axis scale
        Logarithmic - use logarithmic Y axis scale
    Show date axis - turn on/off date display on X axis
    Show middle lines - display automatic Y axis grid lines spaced evenly between minimum and maximum
    Show upper/lower limits - display minimum and maximum Y axis value labels
    Show % values - display values as percents
    Levels - allows to turn on grid lines at some fixed, popular levels such as 30/70, 20/80, 10/90, -100/+100, 0
    Show trading arrows - when turned ON this pane will show buy/sell/short/cover arrows generated by corresponding options available from Automatic Analysis menu.
    File path (locked) - shows the path to the formula file that given chart uses
    Chart ID (locked) - shows the numeric value of Chart ID given pane uses. Chart ID does not matter unless you use Study() function in your formula(s).

Hi Tomasz,
Can we set this custom scaling using AFL code?


You can adjust the Y axis as described in the User Guide,

• minvalue and maxvalue - (used by styleOwnScale plots ONLY) define plot minimum and maximum values (lower and upper boundary for Y axis)

Also recent similar topic discussed on this forum,

Many more examples of what can be done with indicators and charts are in the tutorials and the Official Knowledge Base

Like some of these topics,


Yes you can to that easily using SetChartOptions() function.

Anyway to remove the grids for specific panes?
If I set it in Tools > Preferences > Axes/Grids, it will effect all panes.


Right-click on the chart pane, Parameters, then “Axes & Grid” then select grid of your choice.

And again, almost every question is answered already in the Knowledge Base:

Just curious, I have a 5 second chart with a volume sub plot. Every time a new bar opens, the volume does an entire plot "Rock upwards" to show the zero volume then as a trade occurs it then causes the plot to "Rock back back down". Axes and Grid is set to Automatic.

Question: Is there a way to set the minimum to a hard value like 0, but leave the maximum in Automatic mode?