I put a lot of functions into a code and plot as one indicator with 14 cells in the scanner. But the setplotbgcolor doesnt plot always right in beta 2.
Somebody else have this problem?
Wrong SetplotBGcolor in Scanner
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
you can do this simple test...
right after your setplotbgcolor statement,
add a plot statement to display the color name:
eg.
if the color assignment is correct,
you will see the plot2 color name the same as
the bgcolor in plot1 set by the setplotbgcolor statement.
right after your setplotbgcolor statement,
add a plot statement to display the color name:
eg.
Code: Select all
if condition1 = true then
begin
plot1( value1, "value1");
setplotbgcolor(1, yellow);
plot2( "Yellow" ); {<--- add this plot)
end;
you will see the plot2 color name the same as
the bgcolor in plot1 set by the setplotbgcolor statement.
TJ, the plot colors change on different conditions in the code, so your static solution wont help.
On the picture on the left side the code was inserted in the morning, on the right side after "Last" it was added at the moment.
On the left side the numbers in the rows are still correct, but the colors are wrong and differ from the rigth side.
So the problem occurs after some bars or if i open a saved workspace with the indicators on.
PS: For the scanner there is no option "Save Image" or "Print" like for the charts.
On the picture on the left side the code was inserted in the morning, on the right side after "Last" it was added at the moment.
On the left side the numbers in the rows are still correct, but the colors are wrong and differ from the rigth side.
So the problem occurs after some bars or if i open a saved workspace with the indicators on.
PS: For the scanner there is no option "Save Image" or "Print" like for the charts.
Last edited by SP on 11 Jan 2010, edited 1 time in total.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
this is not a static solution.
this is a debug test.
You insert this plot statement AFTER EVERY setplotbgcolor statement.
ie. every time you make a bgcolor change,
MC will immediately print the name of the color on the scanner.
so that you can visually identify whether MultiCharts is plotting the color you want.
If the bgcolor and the color name are the same, but not the color you want, then there is a bug in your logic,
If the bgcolor and the color name are NOT the same, then there is a bug in MultiCharts.
.
this is a debug test.
You insert this plot statement AFTER EVERY setplotbgcolor statement.
ie. every time you make a bgcolor change,
MC will immediately print the name of the color on the scanner.
so that you can visually identify whether MultiCharts is plotting the color you want.
If the bgcolor and the color name are the same, but not the color you want, then there is a bug in your logic,
If the bgcolor and the color name are NOT the same, then there is a bug in MultiCharts.
.
Last edited by TJ on 11 Jan 2010, edited 1 time in total.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
you can give this a try:
apply this indicator to a fast chart (eg tick chart) so that you can see the changes quickly.
.
apply this indicator to a fast chart (eg tick chart) so that you can see the changes quickly.
Code: Select all
{---condition1---}
if c > h[1] then
begin
plot1( c, "C");
setplotbgcolor(1, yellow);
plot2( "1=Yellow" );
end
else
{---condition2---}
if c < l[1] then
begin
plot1( c, "C");
setplotbgcolor(1, red);
plot2( "2=red" );
end
else
{---condition3---}
begin
plot1( c, "C");
setplotbgcolor(1, lightgray);
plot2( "3=gray" );
end;
.
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
you can use this free screen capture program:...
PS: For the scanner there is no option "Save Image" or "Print" like for the charts.
one touch of a hot-key captures the screen/window...
it is much faster than the MultiCharts built-in save image function.
http://www.wisdom-soft.com/
So i should look like this ?
Code: Select all
Plot2 ( metacounter, "META CB" ,black);
if (metacounter = -8 or metacounter =-7 or metacounter =-6 or metacounter =-5) then SetPlotBGColor (2, Red)
else if (metacounter = -4 or metacounter =-3 or metacounter =-2 ) then SetPlotBGColor (2, Magenta)
else if (metacounter = -1 or metacounter = 0 or metacounter =1 ) then SetPlotBGColor (2, White)
else if (metacounter = 2 or metacounter = 3 or metacounter = 4 ) then SetPlotBGColor (2, Cyan)
else if (metacounter = 5 or metacounter = 6 or metacounter = 7 or metacounter = 8 ) then SetPlotBGColor (2, Green);
Code: Select all
if (metacounter = -8 or metacounter =-7 or metacounter =-6 or metacounter =-5) then Plot3 (" Red")
else if (metacounter = -4 or metacounter =-3 or metacounter =-2 ) then Plot3 (" Magenta")
else if (metacounter = -1 or metacounter = 0 or metacounter =1 ) then Plot3 (" White")
else if (metacounter = 2 or metacounter = 3 or metacounter = 4 ) then Plot3 (" Cyan")
else if (metacounter = 5 or metacounter = 6 or metacounter = 7 or metacounter = 8 ) then Plot3 (" Green");
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times
- TJ
- Posts: 7740
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2221 times