Custom Indicator plots different line

Questions about MultiCharts and user contributed studies.
LMC
Posts: 28
Joined: 08 Jul 2010

Custom Indicator plots different line

Postby LMC » 05 Oct 2010

Hi,

Accidentally I encounter the following situation,

1. I plot Adaptive Moving Average, AdaptiveMovAvg(c, X,Y,Z) on my chart. It plots correctly.
2. However, if I put the function into a custom indicator it plots another line.
Custom indicator codes ,
vars: AMAline(0);
AMAline = AdaptiveMovAvg(c,X,Y,Z);
plot1(AMAline,"AMA");

Can anyone help ?
Thanks.

LMC

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Custom Indicator plots different line

Postby Dave Masalov » 06 Oct 2010

Dear LMC,

You use the same function in both cases, its value is plotted.
If indicators have exactly the same settings(such as Maximum Bars Study will reference), then plots should have the same values.
If it is not the case, please explain the problem in details and post full codes of the indicators.

LMC
Posts: 28
Joined: 08 Jul 2010

Re: Custom Indicator plots different line

Postby LMC » 06 Oct 2010

Hi Dave,

Please refer to the attached screen shot,

1. The red line, AMA Alert, is plotted by a simple 'custom' indicator, just four lines of code,

inputs: price(close), EF(10), Fast(2),Slow(30);
vars: alertline(0);
alertline=adaptivemovavg(c,EF,Fast,Slow);
plot1(alertline,"Trade Alert");

2. The yellow line, Mov Avg Adaptive is plotted simply by the built-in function 'AdaptiveMovAvg',
with exactly the same inputs as for red line in above, ie,
Price = close
EF = 10,
Fast moving average = 2,
Slow moving average = 30,

As said, they should have plotted in the same place. But they are not !
However, they display the same value of 79.39 in the top row !

Please help.

LMC
Attachments
strange AMA plotting.jpg
(523.56 KiB) Downloaded 397 times

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Custom Indicator plots different line

Postby Dave Masalov » 07 Oct 2010

Dear LMC,

Please make sure that both indicators have the same scaling settings (rightclick on the chart-->Format Studies --> Format --> Scaling), i.e. Same as Instrument.

LMC
Posts: 28
Joined: 08 Jul 2010

Re: Custom Indicator plots different line

Postby LMC » 08 Oct 2010

It's OK now, thanks Dave

User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 489 times

Re: Custom Indicator plots different line

Postby Dave Masalov » 11 Oct 2010

Dear LMC,

You are welcome.


Return to “MultiCharts”