The following code is crashing MC when applied.
{Plot1("Close");}
If Close > Close[1] Then Plot1("Higher Close")
else
Plot1("Lower Close");
I presume this is because there is no Plot statement defined but it compiles ok This is occurring on Version 6.01 Build 3081
I am trying to plot Higher or Lower close in the scanner window and change the background colour as well. I believe this is one of the cases where the use of Plot differs slightly from TS use. In the EL Ref manual it states you can use
Plot1("Up", "Upward Value", Green"); but although this will compile in MC does not work. (The "Upward Value" should show as a column heading in the scanner).
I presume that to do what I want ie show different text with different colours in the scanner I will have to use two plot statements and a condition statement as it appears the text version of the plot statement only takes one parameter.
I have read the Help guide but any advice would be appreciated
Plot statement crashes Multicharts
-
- Posts: 18
- Joined: 19 Sep 2009
- Been thanked: 2 times
Re: Plot statement crashes Multicharts
MicroTrader,
in your 'Plot'-statement is nothing declared to plot.
In your case it should be like :
Please try to implement it in your screener. Hope it works.
Regards.
Mike
in your 'Plot'-statement is nothing declared to plot.
In your case it should be like :
Code: Select all
input: upcolor(green);
input: dncolor(red);
input: equalcolor(white);
var: color(0);
var: price(0);
price=close;
if price[0]>price[1] then color=upcolor else if price[0]=price[1] then color=equalcolor else if price[0]<price[1] then color=dncolor;
plot1(price,"Close-Dir", default, color);
Regards.
Mike
-
- Posts: 18
- Joined: 19 Sep 2009
- Been thanked: 2 times
Re: Plot statement crashes Multicharts
Mike
Yes this plots the price with a coloured background in the scanner window, which I have worked out to do from the manuals. What I wish to do is to plot text in the scanner window with a change in background colour. Ie how do I plot "Up" in blue or plot "Down" in red? I guess I have two use 2 plot statements somehow
MicroTrader
Yes this plots the price with a coloured background in the scanner window, which I have worked out to do from the manuals. What I wish to do is to plot text in the scanner window with a change in background colour. Ie how do I plot "Up" in blue or plot "Down" in red? I guess I have two use 2 plot statements somehow
MicroTrader
-
- Posts: 18
- Joined: 19 Sep 2009
- Been thanked: 2 times
Re: Plot statement crashes Multicharts
Found that the following will work ok:
if close > close[1] then begin
plot1("Test1","Alert1",black,yellow);
plot2("Test2","Signal1",black,yellow);
end;
This plots Test1 and Test 2 in the scanner window with Alert1 and Signal1 headings. It would seem therfore that this use of the plot statement does work contrary to what I wrote in post 1.
I did notice however that if a change to the script is made without first removing the study from the scanner window, MC will crash.
if close > close[1] then begin
plot1("Test1","Alert1",black,yellow);
plot2("Test2","Signal1",black,yellow);
end;
This plots Test1 and Test 2 in the scanner window with Alert1 and Signal1 headings. It would seem therfore that this use of the plot statement does work contrary to what I wrote in post 1.
I did notice however that if a change to the script is made without first removing the study from the scanner window, MC will crash.
Re: Plot statement crashes Multicharts
MicroTrader,
Have you submitted the issue to Project Management ? Imho it will stand a better chance to be addressed timely.
Have you submitted the issue to Project Management ? Imho it will stand a better chance to be addressed timely.
Re: Plot statement crashes Multicharts
MicroTrader,
no, you don't need two 'plot'-statements. You can implement everything in one statement like this (just modified the old code) :
I know the code is 'much' longer, but putting everything in variables because of conditions is making the 'plot'-statement much faster and less memory extensive.
May this is what you are looking for.
Mike
no, you don't need two 'plot'-statements. You can implement everything in one statement like this (just modified the old code) :
Code: Select all
input: upcolor(blue);
input: dncolor(red);
input: equalcolor(white);
var: colorfront(0);
var: colorback(0);
var: filter("");
var: price(0);
price=close;
if price[0]>price[1] then begin
filter="up";
colorback=upcolor;
colorfront=white;
end
else
if price[0]=price[1] then begin
filter="-";
colorback=equalcolor;
colorfront=black;
end
else
if price[0]<price[1] then begin
filter="dn";
colorback=dncolor;
colorfront=white;
end;
plot1(filter,"Close-Dir", colorfront, colorback);
May this is what you are looking for.
Mike
-
- Posts: 18
- Joined: 19 Sep 2009
- Been thanked: 2 times
Re: Plot statement crashes Multicharts
Mike
Thanks your script is working fine. Obviously I was not using enough parameters in the plot statement originally for it to work properly in the scanner.
I notice that even on your script, if a change is made in the power language editor and compiled without first removing the indicator from the scanner, strange things happen. First the plots are moved to the next column, then on removing the indicator MC crashes. So Geizer I will be reporting this to project management.
MicroTrader
Thanks your script is working fine. Obviously I was not using enough parameters in the plot statement originally for it to work properly in the scanner.
I notice that even on your script, if a change is made in the power language editor and compiled without first removing the indicator from the scanner, strange things happen. First the plots are moved to the next column, then on removing the indicator MC crashes. So Geizer I will be reporting this to project management.
MicroTrader
Re: Plot statement crashes Multicharts
MicroTrader,
I never had this issue and I never experienced on that. The only thing I experienced is if you used to use more 'plots' or 'tl' in your previous code then in the current code, then you always have to delete and insert your study again. In chart and screener application. But my MC never crashed. May something happened on your MC-installation. Please ask support about.
Regards.
Mike
I never had this issue and I never experienced on that. The only thing I experienced is if you used to use more 'plots' or 'tl' in your previous code then in the current code, then you always have to delete and insert your study again. In chart and screener application. But my MC never crashed. May something happened on your MC-installation. Please ask support about.
Regards.
Mike
-
- Posts: 18
- Joined: 19 Sep 2009
- Been thanked: 2 times
Re: Plot statement crashes Multicharts
Mike
What version of MC are you running? I am on 6.01 build 3081. I believe there is now a 6.1 version
available.
MicroTrader
What version of MC are you running? I am on 6.01 build 3081. I believe there is now a 6.1 version
available.
MicroTrader
-
- Posts: 18
- Joined: 19 Sep 2009
- Been thanked: 2 times
Re: Plot statement crashes Multicharts
Mike
Upgraded to 6.1 Build 3605. The problem of MC crashing when recompiling has gone away now.
Thanks again
Upgraded to 6.1 Build 3605. The problem of MC crashing when recompiling has gone away now.
Thanks again