noplot

Questions about MultiCharts and user contributed studies.
iso
Posts: 204
Joined: 08 Feb 2006
Has thanked: 1 time
Been thanked: 1 time

noplot

Postby iso » 28 Oct 2011

Hi,
I am trying to plot in a scanner window when there is a narrow range bar. I am using code that I have used in TS but it isn't working with mc.

Code: Select all

if range < lowest(range,6)[1] then
begin
plot1(1,"NRx");
SetPlotBGColor(1,blue);
SetPlotColor(1,blue);
end
else begin
noplot(1);
end;

I have also copied a line out of the multicharts user guide on plot statements and I couldn't get it to work as stated...

Plot the closing price, offset back by 3 bars, using the plot color of blue, using cell background color of green if this plot is applied to a scanner, line width of 3, and name the plot "Close 3 bars later":

Code: Select all

Plot1[3](Close,"Close 3 bars later",Blue,Green,3);

Also multicharts is crashing intermittently as I try to compile this.

<<EXCEPTION>>
Address: 0x60D6EF77 ( 1624698743 )
Code: 0xC0000005 ( -1073741819 )
Continuable: 0x00000000 ( 0 )
Description: The instruction at 0x
ErrorCode: 0xC0000005 ( -1073741819 )
ExceptionType: 0x00000000 ( 0 )
Module: C:\Program Files (x86)\TS Support\MultiCharts\StudyRunner.dll
Process: C:\Program Files (x86)\TS Support\MultiCharts\MultiCharts.exe
Thread ID: 0x00001004 ( 4100 )
Time: 28.10.2011 - 16:40:46.276


Thanks

iso
Posts: 204
Joined: 08 Feb 2006
Has thanked: 1 time
Been thanked: 1 time

Re: noplot

Postby iso » 28 Oct 2011

Thanks TJ

Why doesn't it work as documented, also why doesn't it print what is in the quotes?

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

Re: noplot

Postby TJ » 28 Oct 2011

Thanks TJ

Why doesn't it work as documented, also why doesn't it print what is in the quotes?
But does my solution work?

User avatar
JoshM
Posts: 2195
Joined: 20 May 2011
Location: The Netherlands
Has thanked: 1544 times
Been thanked: 1565 times
Contact:

Re: noplot

Postby JoshM » 29 Oct 2011

I have also copied a line out of the multicharts user guide on plot statements and I couldn't get it to work as stated...

Plot the closing price, offset back by 3 bars, using the plot color of blue, using cell background color of green if this plot is applied to a scanner, line width of 3, and name the plot "Close 3 bars later":

Code: Select all

Plot1[3](Close,"Close 3 bars later",Blue,Green,3);
I think you misunderstood the documentation. According to the EasyLanguage Essentials guide (pdf page 62):
Once you have defined a plot using the PlotN reserved word, you can reference the value of the plot in other EasyLanguage statements.

Usage Example:

Code: Select all

Plot1(Average(Close, 10), "Avg Close");
if Close crosses above Plot1[1] then Alert;
In this example, the reserved word Plot1 is used to display an average. The value of the plot is also referenced in the next statement in order to write the alert criteria. This allows you to historically reference plot values. Notice that the plot reference above is for the previous bar value of the plot statement.
So, in effect, you'll first need to create the PlotN() statement, and then reference it (so not at the same time as you did in your code example).

Btw, why not use..

Code: Select all

Plot1(Close[3], "Close three bars ago");
Regards,
Josh

SP
Posts: 465
Joined: 06 Feb 2006
Has thanked: 36 times
Been thanked: 286 times

Re: noplot

Postby SP » 29 Oct 2011

In my experience it is better to change the cell background in the scanner instead of using NoPlot.

Code: Select all

once begin value1 = getbackgroundcolor;end;
plot1("Narrow Range","NRx");
if range < lowest(range,6)[1] then
begin
SetPlotBGColor(1,blue);
SetPlotColor (1,black);
end
else begin
SetPlotBGColor(1,value1 );
SetPlotColor (1,value1 );
end;

iso
Posts: 204
Joined: 08 Feb 2006
Has thanked: 1 time
Been thanked: 1 time

Re: noplot

Postby iso » 29 Oct 2011

I guess I am curious what the difference is between how TS runs the code and how multicharts runs it. Much of my code that I have been running for many years in TS doesn't run the same in MC. I'm trying to figure out where to get help as the tutorials say it should work one way but sometimes that's not the case.

Thanks for the replies

vking
Posts: 235
Joined: 21 May 2009
Has thanked: 51 times
Been thanked: 41 times

Re: noplot

Postby vking » 29 Oct 2011

I would like to post my observation on plots and the difference between MC & TS:

- in TS:
plot2 would plot first and then plot1 - highest plot number to lowest

- in MC:
plot1 would plot first and then plot2 - lowest plot number to highest

Example code:
plot1(close,"1",red);
plot2(close,"2",green);

TS - Would plot red line
MC - Would plot green line

- TS & MC are not exactly the same w.r.t plots and don't know the reason MC took this route of changing the plot order. MC's way is more meaningful but just the opposite of TS in this area.

Thanks


Return to “MultiCharts”