PlotPB works differently in MC, TS2ki, and TS8

Questions about MultiCharts and user contributed studies.
2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

PlotPB works differently in MC, TS2ki, and TS8

Postby 2haerim » 14 Oct 2007

Attached are 3 screen shots plotted by the following analysis technic:

ts82.gif is from TS8.2 and plots as expected.
picture1.png(OHLC chart) and picture2.png(candle chart) are from MC.
Apparently MC does not support PlotPB yet.

However, the strange thing is that TS2ki also plots the same as MC even though TS2ki supports PaintBar.

Some explanation please.

Any ETA for PaintBar support?

I don't have the dll for the above code, but it seems that dll itself is not important factor for this phenomenon.


DefineDLLFunc: "C:\Program Files\Kwik POP for TS\kptrade.dll", int, "E_CREATESTATE2", int;
DefineDLLFunc: "C:\Program Files\Kwik POP for TS\kptrade.dll", int, "E_CHECKSTATE", int;
DefineDLLFunc: "C:\Program Files\Kwik POP for TS\kptrade.dll", int, "E_BARVALUES", int, int, int, int, double, double, double, double, double;
DefineDLLFunc: "C:\Program Files\Kwik POP for TS\kptrade.dll", double, "E_GETRETURN", int, int;
DefineDLLFunc: "C:\Program Files\Kwik POP for TS\kptrade.dll", double, "E_TSKPCOLORTMPL", int;

{ no inputs }

Vars: stateID(0), cum1(0), bv(0), triggerline(0), check(0), sum(0), row(0);
Arrays: values[9](0);

cum1 = CurrentBar;

{ Time and date are already in the format we want }
if( stateID = 0 ) then
begin
stateID = E_CREATESTATE2( (INT)0 ); { 0 means no garbage collection }
print ("StateID", stateID);
end
else
begin
check = E_CHECKSTATE(stateID);
if( check = 0 ) then
begin
print ("Check state failed on bar",cum1);
end;

end;


if( stateID <> 0 ) then
begin
bv = E_BARVALUES( stateID, cum1, date, time, open, high, low, close, volume );
if( bv <> 0 ) then
begin
E_TSKPCOLORTMPL(stateID);

{ retrieve all of the values }
sum = 0;
for row = 0 to 9 begin
values[row] = E_GETRETURN(stateID,row+1); // 1 means second return, 0 based indexing.
if( values[row] > 0 ) then
sum = sum + 1
else if( values[row] < 0 ) then
sum = sum - 1;
end;

end
else
begin
Print("Barvalues failed on bar",cum1);
end;

end;


{ Leave the following as is. The plot is not named because there is only one PaintBar
plot - with two sub-plots - and the default names Plot1, Plot2 will be adequate. The
alert does not include a description because the alerting criteria and the plotting
criteria are the same, and the description will be redundant. }

if( sum >= +5 ) then
begin
PlotPB(High, Low, Open, Close, "ScCdColors", Blue );
end
else if( sum <= -5 ) then
begin
PlotPB(High, Low, Open, Close, "ScCdColors", Red );
end
else
begin
PlotPB(High, Low, Open, Close, "ScCdColors", Yellow );
end;
Attachments
ts82.gif
(5.81 KiB) Downloaded 735 times
picture1.png
(26.32 KiB) Downloaded 736 times
picture2.png
(24.2 KiB) Downloaded 735 times

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 15 Oct 2007

Dear Haerim,

MultiCharts does support PaintBar. If you'd like us to analyse the problem, could you please send us the code as an ELA/ELS file, the dll used, and the workspaces you applied those to?

Thank you.

User avatar
ABC
Posts: 718
Joined: 16 Dec 2006
Location: www.abctradinggroup.com
Has thanked: 125 times
Been thanked: 408 times
Contact:

Postby ABC » 15 Oct 2007

Marina,

you won't need the code to reproduce the problem 2haerim is referencing to.

MC is supporting PaintBars, however the results on Candlesticks are varying between TS and MC. TS automatically changes the PaintBar style to match the candlesticks, where MC seems not to behave this way, but still show OHLC paintbars. You can see this on 2haerims images and reproduce it with this simple code:

Code: Select all

If High > High[1] then
PlotPB(High, Low, Open, Close, "PBTEST", blue)
else
PlotPB(High, Low, Open, Close, "PBTEST", red);
Best regards,
ABC

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 15 Oct 2007

Dear ABC,

Thank you for your advice.

However, the reason why I requested the code is that it's our programmers' standard requirement.

Regards.

2haerim
Posts: 502
Joined: 01 Sep 2006
Been thanked: 2 times

ABC is right. I don't have the dll but you can reproduce

Postby 2haerim » 15 Oct 2007

This problem has been reported by one of my customers and as ABC pointed out, it is reproduced without dlls.

Please try ABC's simple code to see the problem.

User avatar
Geoff
Posts: 198
Joined: 18 Apr 2007
Has thanked: 15 times
Been thanked: 4 times

Postby Geoff » 15 Oct 2007

TS added the ability to apply paintbars to candlesticks in version 8.3, previous versions act in the same way as MC and TS2000i.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Re: ABC is right. I don't have the dll but you can reprodu

Postby Marina Pashkova » 16 Oct 2007

This problem has been reported by one of my customers and as ABC pointed out, it is reproduced without dlls.

Please try ABC's simple code to see the problem.
Dear Haerim,

There is always a reason why whenever our customers experience problems with studies we ask them to send us those studies as separate files in the respective format. I would appreciate it if you sent us the file. Once we receive it we can start processing the issue.

Thank you.

User avatar
Marina Pashkova
Posts: 2758
Joined: 27 Jul 2007

Postby Marina Pashkova » 18 Oct 2007

Hi Haerim,

Our engineers have confirmed that there is a bug in the way Ptb works in MultiCharts.

We'll start working to correct that.

Regards.


Return to “MultiCharts”