PlotPaintBar (Reserved Word)
This reserved word is used only within a PaintBar study, and enables you to paint the entire bar a specified color or paint the bar between two specified values.
PlotPaintBar( BarHigh, BarLow [, BarOpen [, BarClose [, "<PlotName>"[, ForeColor[, Default[, Width]]]]]] );
BarHigh, BarLow, BarOpen and BarClose are numeric expressions representing the high, low, open and closing prices for the bar to be drawn by the PaintBar study, and <PlotName> is the name of the plot. ForeColor is an Easy Language color used for the plot (also referred to as PlotColor), Default (reserved for future use), and Width is a numeric value representing the width of the plot.
Remarks
You can also specify only two of the bar parameters instead of the four: BarHigh, BarLow, BarOpen or BarClose. However, you must specify either two or four of the bar parameters.
EasyLanguage will automatically append a number from 1 - 4 to each of the four plot statements represented by the statement, so as to be able to individually identify each plot name in EasyLanguage. If the maximum number of characters for the PlotName is used, the last character in the string will be dropped and replaced with the appropriate number for each plot. If the PlotName parameter is not included, the plots will be assigned the generic plot names Plot1 - Plot4.
You can abbreviate the PlotPaintBar reserved word to PlotPB. Also, you can use the Plot reserved word described previously to write a PaintBar study; however, we recommend you use the PlotPaintBar reserved word.
When applying the analysis technique to a chart, you can displace the plot to the right or left. For example:
PlotPaintBar[3](Value1);
The above example calculates the plot value using the current bar but draws it on the chart 3 bars ago. Use a negative number to draw the value 3 bars ahead of the current bar.
Notes
The parameter Default currently has no effect. However, a value for the parameter is required in order to specify a width, as discussed in the example.
Example
For example, the following instructions can be used in order to paint red the bars with twice the 10-bar average of the volume:
If Volume > 2 * Average(Volume, 10) Then
PlotPB(High, Low, Open, Close, "AvgVol", Red );
Additional Example
The following instructions paint the area between the two plots of the Bollinger Bands Indicator when the 14-bar ADX value is lower than 25:
Variables: Top(0), Bottom(0);
Top = BollingerBand(Close, 14, 2);
Bottom = BollingerBand(Close, 14, -2);
If ADX(14) < 25 Then
PlotPaintBar(Top, Bottom, "Area", Blue);
In this last example, notice that although we omitted the BarOpen and BarClose parameters, we are still able to specify the name and color of the plot.