Why is my PlotPaintBar output in a line?

Questions about MultiCharts and user contributed studies.
TycoonTrader
Posts: 3
Joined: 23 Nov 2016
Has thanked: 1 time

Why is my PlotPaintBar output in a line?

Postby TycoonTrader » 19 Aug 2018

I am new to EasyLanguage and my indicator appears as a line of black and magenta dots at a low point. see attached jpg.

PLease can you advise me what I am doing wrong? I am trying to use the Plotpaintbar function to paint my candlesticks.
Thanks.

[
Capture1.JPG
(77.3 KiB) Downloaded 443 times
img][/img]

MY INDICATOR CODE=
{Paint swing bars depending on UP or DOWN FRACTAL}
VARIABLES:
value1(1), {Barnumber of each bar in chart}
Lobar(0), HiBar(0) , {Bar nos. of fractal Low & high }
HP(0), {High Fractal Point } LP(0), {Low Fractal Point }
Trend(0);
value1=barnumber;
Plot3(Value1);

{Uptrend. Buy when H crosses above HIGH FRACTAL POINT (UP paints bars green)}
condition1 = H[2]>H AND H[2]>H[1] AND H[2]>H[3] AND H[2]>H[4];

{DownTrend. Sell when Low crosses below LOW FRACTAL POINT (Down paints bars magenta)}
condition2 = L[2]<L AND L[2]<L[1] AND L[2]<L[3] AND L[2]<L[4];

If condition1 then
begin
HP=C[2];
Hibar = value1 - 2;
Lobar = 0;
Trend = -1;
PlotPaintBar( High, Low,open,close, "Up",Black );
end
else
If condition2 then
begin
LP=C[2];
Lobar = value1 - 2;
Hibar = 0;
Trend = +1;
PlotPaintBar( High, Low,O,C, "Down",Magenta ) ;

end
else
noplot(1) ;

If close >= LP then
begin

PlotPaintBar( High, Low,open,close, "Up",Black ) ;
end
else
noplot(1);

If Close <= HP then PlotPaintBar( High, Low,O,C, "Down",Magenta )
else
noplot(1) ;

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

Re: Why is my PlotPaintBar output in a line?

Postby TJ » 19 Aug 2018

Please see posts #1 & #2
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: Why is my PlotPaintBar output in a line?

Postby TJ » 19 Aug 2018

This is a scaling problem.

Right click on the indicator,
Select the Scaling tab.
In the Scaling Range section, choose the Same as Instrument option from the list.

TycoonTrader
Posts: 3
Joined: 23 Nov 2016
Has thanked: 1 time

Re: Why is my PlotPaintBar output in a line?

Postby TycoonTrader » 19 Aug 2018

Thank you for your tip about scaling and tagging code.
We are getting there.

When I scroll to May the indicator scales correctly.

May scales ok .JPG
(44.35 KiB) Downloaded 438 times
When I scroll to June's low, the scale still shows a flattish indicator.
Please do you have any more tips?
Thanks.
June low flat.JPG
(57.03 KiB) Downloaded 438 times

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

Re: Why is my PlotPaintBar output in a line?

Postby TJ » 19 Aug 2018

You can delete all the indicators from the chart and add them again.

Make sure when you add the indicator,
at the Format Study window,
select the proper scaling.

Also, check the box for "Use as Default" at the bottom of the Format Study window.

TycoonTrader
Posts: 3
Joined: 23 Nov 2016
Has thanked: 1 time

Re: Why is my PlotPaintBar output in a line?

Postby TycoonTrader » 21 Aug 2018

Bad weird news and good news

THE BAD WEIRD NEWS
I have spent hours adjusting my code and re-checking my chart indicator format and optimisation. However the plot still showed as a straight line from June. Also I examined the stock's data and saw some very big price moves. I saw the Plot1 line was null.
When I applied, my code to other stocks, it ran satisfactorily. However, nothing I tried fixed the strange plot.

THE GOOD NEWS
Then it seemed to fix itself the next day.

I started doing more code testing applying it to other stocks. They worked and displayed ok. Then I went back to the original problem stock and the chart is now displaying my indicator properly.
A strange computer glitch - perhaps.

Thank you for your help.

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

Re: Why is my PlotPaintBar output in a line?

Postby TJ » 21 Aug 2018

Bad weird news and good news

THE BAD WEIRD NEWS
I have spent hours adjusting my code and re-checking my chart indicator format and optimisation. However the plot still showed as a straight line from June. Also I examined the stock's data and saw some very big price moves. I saw the Plot1 line was null.
When I applied, my code to other stocks, it ran satisfactorily. However, nothing I tried fixed the strange plot.

THE GOOD NEWS
Then it seemed to fix itself the next day.

I started doing more code testing applying it to other stocks. They worked and displayed ok. Then I went back to the original problem stock and the chart is now displaying my indicator properly.
A strange computer glitch - perhaps.

Thank you for your help.

After you have set the chart scaling format,
don't forget to SAVE the chart,
otherwise, the configuration will not stay with the chart.


Return to “MultiCharts”