New to MC.. need help with couple questions

Questions about MultiCharts and user contributed studies.
RedK
Posts: 5
Joined: 16 May 2013
Has thanked: 1 time

New to MC.. need help with couple questions

Postby RedK » 16 May 2013

Hi all, just starting my first steps with MC (scripting) - reaching out for help on couple of annoying issues that i'm facing, maybe i'm missing something and you can point me out to the right direction..

1 - i'm scripting a custom indicator that plots an oscillator line with dynamic colors. so above 0 and increasing, it should be green, below 0 and decreasing it would be red, otherwise it would be yellow.. now the resulting calc in reality is a data set of points, which get evaluated against my coloring condition to "paint" the connecting line between any 2 adjacent points. no matter what i do, MC will always color the line section between any 2 points based on the earlier point, and not the latest one (contrary to other scripting platforms that i used). why is this important, because visually, my condition would be true but the line shows the wrong color and it drives me crazy. if you switch the plot type to a histogram, it paints properly (as each histogram bar is directly related to a single point in the dataset and not 2).. i then noticed that this is the same case in the built-in studies - for example, RSI.. RSI will be below 70 (OB) and still shows as Red unitl the next point is evaluated/calculated... and so on
is this a bug in the MC code that renders to the screen? can this be fixed? is there a way around it that i can use in my code(i use dynamic colors extensively and i'm very visual)

2 - in the Editor, is there a way to "Search" on commands, functions and keywords. i can see the dictionary and the bottom pane lists, but can't find a search mechanism. this makes finding what i'm looking for very time consuming? is the "Search" feature available somewhere and i missed it? that would be a great help

thanks in advance for helping.
R

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

Re: New to MC.. need help with couple questions

Postby TJ » 16 May 2013

Hi all, just starting my first steps with MC (scripting) - reaching out for help on couple of annoying issues that i'm facing, maybe i'm missing something and you can point me out to the right direction..

1 - i'm scripting a custom indicator that plots an oscillator line with dynamic colors. so above 0 and increasing, it should be green, below 0 and decreasing it would be red, otherwise it would be yellow.. now the resulting calc in reality is a data set of points, which get evaluated against my coloring condition to "paint" the connecting line between any 2 adjacent points. no matter what i do, MC will always color the line section between any 2 points based on the earlier point, and not the latest one (contrary to other scripting platforms that i used). why is this important, because visually, my condition would be true but the line shows the wrong color and it drives me crazy. if you switch the plot type to a histogram, it paints properly (as each histogram bar is directly related to a single point in the dataset and not 2).. i then noticed that this is the same case in the built-in studies - for example, RSI.. RSI will be below 70 (OB) and still shows as Red unitl the next point is evaluated/calculated... and so on
is this a bug in the MC code that renders to the screen? can this be fixed? is there a way around it that i can use in my code(i use dynamic colors extensively and i'm very visual)

thanks in advance for helping.
R
You should code your line plots this way:

Code: Select all

Plot10( RSI, "RSI", color);

Setplotcolor[1](10, color);

RedK
Posts: 5
Joined: 16 May 2013
Has thanked: 1 time

Re: New to MC.. need help with couple questions

Postby RedK » 16 May 2013

that did the trick.. couldn't have ever guessed I can "index" the SetPlotColor function :) .. ok.. need to map this in my mind vs my "other" platform.
Big Thanks..

RedK
Posts: 5
Joined: 16 May 2013
Has thanked: 1 time

Re: New to MC.. need help with couple questions

Postby RedK » 16 May 2013

but now if you set the plot as histogram, the histogram colors are incorrect.. in fact, any other plot type will be incorrect (points...etc)

would it be possible to request this as a feature or a fix? for MC renderer to always evaluate the color of a connecting line between two points in a calculated dataset of an indicator, to be based on the last and not the first point? this way it aligns to other charting apps.

thx, K

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

Re: New to MC.. need help with couple questions

Postby TJ » 16 May 2013

but now if you set the plot as histogram, the histogram colors are incorrect.. in fact, any other plot type will be incorrect (points...etc)

would it be possible to request this as a feature or a fix? for MC renderer to always evaluate the color of a connecting line between two points in a calculated dataset of an indicator, to be based on the last and not the first point? this way it aligns to other charting apps.

thx, K
MultiCharts has no way of knowing what type of plot you have set for your graph.

People don't usually change between line plots and histogram plots, it is not a big deal to think ahead of time when you code.

If you want to make it a portable code,
you can try this:

Code: Select all

input:
Histogram0.Line1(1); // enter 0 for histogram, 1 for line

Plot10( RSI, "RSI", color );

Setplotcolor[ Histogram0.Line1 ]( 10, color );


Return to “MultiCharts”