PlotOHLC
- plot custom OHLC chart

Exploration / Indicators
(AmiBroker 4.20)


SYNTAX PlotOHLC( open, high, low, close, name, color/barcolor, style = styleCandle | styleOwnScale, minvalue = {empty}, maxvalue = {empty}, XShift = 0, ZOrder = 0, width = 1 )
RETURNS NUMBER
FUNCTION Plots the price chart using custom open, high, low, close arrays supplied as parameters. Fifth argument name defines graph name used for displaying values in a title bar. Graph color could be static (if sixth argument is a number) or dynamic (when sixth argument is an array). Color indexes are related to the current palette (see Preferences/Color)
style defines chart plot style (see Plot() function for possible values)
minvalue and maxvalue - (used by styleOwnScale plots ONLY) define plot minimum and maximum values (lower and upper boundary for Y axis)

XShift - allows to visually shift the chart into future (blank) bars.

ZOrder - this parameter takes precedence over the order of calling Plot() functions, so if z-order is set, it determines plotting order. See http://www.amibroker.com/gifs/zorder.gif
If multiple plots use the same z-order parameter they are plotted in reverse call order (ones that appear last in the code are plotted first). This rule can be changed by already existing switch graphzorder = 1 which, when specified, reverses this behaviour (so plots are drawn in call order).

Please note the above applies to each zorder "layer" separately (so within same zorder "layer" reverse call rule applies) This may sound complicated but is required for backward compatibility.

width - defines pixel or percent width of given plot. The default is 1 pixel. Positive values specify PIXEL width, negative values specify width in percent of current bar width. So for example -20 will give you dynamic width that is 20% of bar width. Example: Plot( C, "Close", colorBlack, styleBar, Null, Null, 0, 1, -20 /* line width as percent of bar */ );

EXAMPLE PlotOHLC( 1.1*Open, 1.1* High, 1.1* Low, 1.1* Close, "Price chart shifted 10% up", colorRed, styleCandle );
SEE ALSO PLOT() function , PLOTFOREIGN() function

References:

The PlotOHLC function is used in the following formulas in AFL on-line library:

More information:

See updated/extended version on-line.