Page 1 of 1

Offsetting SetPlotColor

Posted: May 13 2008
by dougm_tx
In TS, you can offset setplotcolor as in:

setplotcolor[1](1,red)

The offset doesn't seem to have any effect with MC,

Posted: May 13 2008
by TJ
mine works ok.


bear in mind that the plot color timing appear differently when plot as histogram than a line.
Try it out with both of these 2 plot types and see.

Posted: May 14 2008
by sparkz
No problem here with lines or histograms.

When setting the colour of the current bar there's a subtle difference between histograms and lines. With a histogram, the current bar is coloured with your new colour. With a line, it's the segment from the current bar to next that takes the new colour. ie. you don't see it until the current bar is over.

I don't know if that's any different to the way TS works. I've never used it, only MC.

Posted: May 14 2008
by dougm_tx
sparkz,

You've described the behavior the the offsetting should change. This only applies to lines, not histo's, dots etc.

The goal is to change the line color of the segment between the prior bar and the current bar based on what the current bar does intrabar.

I'll post pics of the difference between MC and TS a little later today.

Posted: May 14 2008
by dougm_tx
Here's a pic showing the difference. Its a standard price channel modified to show when the bands push up or down.

Posted: May 14 2008
by sparkz
Sorry Doug, that's what I meant.

I didn't know about TS doing it differently to MC. It certainly seems more logical.

I tend to write my indicators specifically for a line or histogram, so set the colour 1 bar back or on the current bar as required.

Of course if you want to the change the line type you have to edit the code which isn't going to be great if you haven't got it!

Posted: May 14 2008
by dougm_tx
hey sparkz,

As i re-read my post above, sounded a little brusque...sorry, was suffering a bit with a gold position.

Looks like you've solved it with your plots. I'll mess with it some, it's my code.

Still, it seems like something the good people at MC might want to look at if their goal is maximum EL compatibility.

cheers

Posted: May 14 2008
by fs
hey sparkz,

As i re-read my post above, sounded a little brusque...sorry, was suffering a bit with a gold position.

Looks like you've solved it with your plots. I'll mess with it some, it's my code.

Still, it seems like something the good people at MC might want to look at if their goal is maximum EL compatibility.

cheers
This works exactly like this in TS. Look at the freely available code for the Hull Moving Average for TS and you will see one of the parameters is to change the color one bar back due to how coloring lines works.

- Fanus

Posted: May 14 2008
by TJ
Here's a pic showing the difference. Its a standard price channel modified to show when the bands push up or down.
are you using the same code to make these 2 graphs?
or are you using the "same" indicator only?



p.s. I notice you use !_ as indicator prefix. I do the same to keep my list on the top. ;-)

Posted: May 14 2008
by dougm_tx
hmmm,

The Hull MA does seem to work correctly...i have the 'jtHMA'.

TJ, its the exact same code exported from TS to MC.

Posted: May 14 2008
by dougm_tx
OK made it work.

MC support : below is some very simple code that shows a case where code works differently in MC 3.0 and TS 8.3.

Code: Select all

Input:PClen(5);
vars:pcup(0),pclo(0);
vars:UpColor(yellow);
pcup = HighestFC(H,PClen);
plot1(pcup);



// This code works properly in both TS and MC
if pcup[1] < pcup[0] then SetPlotColor[1](1,green)
else if pcup[1] > pcup[0] then SetPlotColor[1](1,red)
else SetPlotColor[1](1,black);

{
// This code works properly only in TS
if pcup[1] < pcup[0] then UpColor = green
else if pcup[1] > pcup[0] then UpColor = red
else UpColor = black;
SetPlotColor[1](1,UpColor);
}

Posted: May 15 2008
by Marina Pashkova
OK made it work.

MC support : below is some very simple code that shows a case where code works differently in MC 3.0 and TS 8.3.

Code: Select all

Input:PClen(5);
vars:pcup(0),pclo(0);
vars:UpColor(yellow);
pcup = HighestFC(H,PClen);
plot1(pcup);



// This code works properly in both TS and MC
if pcup[1] < pcup[0] then SetPlotColor[1](1,green)
else if pcup[1] > pcup[0] then SetPlotColor[1](1,red)
else SetPlotColor[1](1,black);

{
// This code works properly only in TS
if pcup[1] < pcup[0] then UpColor = green
else if pcup[1] > pcup[0] then UpColor = red
else UpColor = black;
SetPlotColor[1](1,UpColor);
}
Hi guys,

The code really works differently in MC and TS. This is an MC bug. Our engineers will be working to fix it.

Thanks for reporting!

Posted: May 15 2008
by TJ
Hi guys,

The code really works differently in MC and TS. This is an MC bug. Our engineers will be working to fix it.

Thanks for reporting!
oh shocks... I have to rewrite all my codes

:-(