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

Hello,

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

Than

ks,

Kevin (knickname “Joe”)

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

Snoopy

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

... http://www.amibroker.com/guide/w_param.html

The following options are available:

Axes
    Scaling:
        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)
    Type
        Linear - use linear Y axis scale
        Logarithmic - use logarithmic Y axis scale
    Show date axis - turn on/off date display on X axis
Grid
    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
Miscellaneous
    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?

Thanks

You can adjust the Y axis as described in the User Guide,
http://www.amibroker.com/guide/afl/plot.html

• 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
https://www.amibroker.com/guide/tutorial.html
http://www.amibroker.com/kb/toc/

Like some of these topics,

2 Likes

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

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

Thanks
Chung

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:
http://www.amibroker.com/kb/2016/01/17/adding-custom-grid-levels-to-rsi-indicator/

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?

-S