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;