PlotPaintBar Compliler Error

Questions about MultiCharts and user contributed studies.
scg427
Posts: 1
Joined: Sep 27 2013

Jan 15 2022

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.
Last edited by scg427 on Jan 16 2022, edited 1 time in total.

User avatar
TJ
Posts: 7774
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Jan 15 2022

See post #1 and #2
1. [FAQ] How to Post Codes ... so that people can read.
viewtopic.php?t=11713

User avatar
TJ
Posts: 7774
Joined: Aug 29 2006
Location: Global Citizen
Has thanked: 1036 times
Been thanked: 2233 times

Jan 16 2022

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;