PlotPaintBar Compliler Error

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

PlotPaintBar Compliler Error

Postby scg427 » 15 Jan 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 16 Jan 2022, edited 1 time in total.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: PlotPaintBar Compliler Error

Postby TJ » 15 Jan 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: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: PlotPaintBar Compliler Error

Postby TJ » 16 Jan 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;


Return to “MultiCharts”