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
Custom Indicator plots different line
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Custom Indicator plots different line
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.
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.
Re: Custom Indicator plots different line
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
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
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times
Re: Custom Indicator plots different line
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.
Please make sure that both indicators have the same scaling settings (rightclick on the chart-->Format Studies --> Format --> Scaling), i.e. Same as Instrument.
- Dave Masalov
- Posts: 1712
- Joined: 16 Apr 2010
- Has thanked: 51 times
- Been thanked: 489 times