Page 1 of 1

PlotPaintBar Compliler Error

Posted: Jan 15 2022
by scg427
I am trying to paint the bar color depending on the trend I specified,
my script is as following:

Code: Select all

if trend = 1 then begin SetPlotColor(9, Blue); end; if trend = -1 then begin SetPlotColor(9, red); end; PlotPaintBar(O, H, L, C, 9, default);
I am getting a compile error on the last line statement (Plotpaintbar), Please advise what correct format I should use.

Re: PlotPaintBar Compliler Error

Posted: Jan 15 2022
by TJ
See post #1 and #2
1. [FAQ] How to Post Codes ... so that people can read.
viewtopic.php?t=11713

Re: PlotPaintBar Compliler Error

Posted: Jan 16 2022
by TJ
Please go to Wiki and look up the usage example of PlotPaintBar.



PlotPaintBar is the equivalent of:

Plot1(BarHigh);
Plot2(BarLow);
Plot3(BarOpen);
Plot4(BarClose);

Try this:

Code: Select all

PlotPaintBar(O, H, L, C, "OHLC", default); if trend = 1 then begin SetPlotColor(1, Blue); SetPlotColor(2, Blue); SetPlotColor(3, Blue); SetPlotColor(4, Blue); end else // if trend = -1 then begin SetPlotColor(1, red); SetPlotColor(2, red); SetPlotColor(3, red); SetPlotColor(4, red); end;