Offsetting SetPlotColor

Questions about MultiCharts and user contributed studies.
dougm_tx
Posts: 16
Joined: 15 Aug 2006

Offsetting SetPlotColor

Postby dougm_tx » 13 May 2008

In TS, you can offset setplotcolor as in:

setplotcolor[1](1,red)

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

User avatar
TJ
Posts: 7460
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2141 times

Postby TJ » 13 May 2008

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.

sparkz
Posts: 64
Joined: 16 Mar 2007

Postby sparkz » 14 May 2008

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.

dougm_tx
Posts: 16
Joined: 15 Aug 2006

Postby dougm_tx » 14 May 2008

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.

dougm_tx
Posts: 16
Joined: 15 Aug 2006

Postby dougm_tx » 14 May 2008

Here's a pic showing the difference. Its a standard price channel modified to show when the bands push up or down.
Attachments
MC TS Price Chan Dif.JPG
(135.91 KiB) Downloaded 925 times

sparkz
Posts: 64
Joined: 16 Mar 2007

Postby sparkz » 14 May 2008

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!
Attachments
2008-05-14_165254.jpg
(97.97 KiB) Downloaded 916 times

dougm_tx
Posts: 16
Joined: 15 Aug 2006

Postby dougm_tx » 14 May 2008

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

fs

Postby fs » 14 May 2008

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

User avatar
TJ
Posts: 7460
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2141 times

Postby TJ » 14 May 2008

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. ;-)

dougm_tx
Posts: 16
Joined: 15 Aug 2006

Postby dougm_tx » 14 May 2008

hmmm,

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

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

dougm_tx
Posts: 16
Joined: 15 Aug 2006

Postby dougm_tx » 14 May 2008

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);
}

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

Postby Marina Pashkova » 15 May 2008

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!

User avatar
TJ
Posts: 7460
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 999 times
Been thanked: 2141 times

Postby TJ » 15 May 2008

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

:-(


Return to “MultiCharts”