# 2 indicators have the "same" code but not same value ???

Questions about MultiCharts and user contributed studies.
nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

### 2 indicators have the "same" code but not same value ???

Hi

where is the error
the 2 indicators have the same code but not same value

First indicator : a exp moving average

Code: Select all

`inputs:   Price( Close ),   Length( 200 ),   Displace( 0 ) ;variables:   var0( 0 ) ;var0 = XAverage( Price, Length ) ;condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;if condition1 then    Plot1[Displace]( var0, "AvgExp" ) ;                  `

the second indicator : the first indicator which i had theses lines
Avg.Sd = StandardDev(Price, Avg.Length, 1);
Avg.High = MyAvg + (Avg.Sd * Avg.1stSd);
Avg.Low = MyAvg - (Avg.Sd * Avg.1stSd);

Code: Select all

`Inputs:   Price(Close), Avg.Length(200), Avg.1stSd(0.5),    Avg.UpColor(Green), Avg.DnColor(Red), Avg.1stSdColor(blue),    Show.1stSd(True), Displace( 0 ) ;Variables:   MyAvg(0), Avg.Sd(0), Avg.High(0), Avg.Low(0);MyAvg = XAverage( Price, Avg.Length) ;Avg.Sd = StandardDev(Price, Avg.Length, 1);Avg.High = MyAvg + (Avg.Sd * Avg.1stSd);Avg.Low = MyAvg - (Avg.Sd * Avg.1stSd);condition1 = Displace >= 0 or CurrentBar > AbsValue( Displace ) ;if condition1 then   begin   Plot1[Displace]( MyAvg, "MyAvg" ) ;   Plot2(Avg.High, "Avg.High", Avg.1stSdColor);   Plot3(Avg.Low, "Avg.low", Avg.1stSdColor);   end;`

another question
why the 2 indicators are not displayed after barnumber 200 (input mov avg 200)

nuno
Attachments
Same indicators.png (49.67 KiB) Viewed 355 times

TJ
Posts: 7151
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 988 times
Been thanked: 2041 times

### Re: 2 indicators have the "same" code but not same value ???

nuno-online wrote:Hi

where is the error
the 2 indicators have the same code but not same value

I have just ran a test with your codes,
the values are the same.

see attached.
The thick cyan line is the xaverage from your first indicator,
and the red line (overlay) is from your second indicator.

nuno-online wrote:another question
why the 2 indicators are not displayed after barnumber 200 (input mov avg 200)

nuno

do you have the Max bars back set to auto detect?

Attachments
maxbarsback.gif (18.14 KiB) Viewed 416 times
uno test.png (116.96 KiB) Viewed 356 times

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

### Re: 2 indicators have the "same" code but not same value ???

Thank you TJ
for the 2 indicators, Max bars back set to auto detect
the first indicator is display from barnumber 7
and the second indicator from barnumber 205

Nuno

TJ
Posts: 7151
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 988 times
Been thanked: 2041 times

### Re: 2 indicators have the "same" code but not same value ???

nuno-online wrote:Thank you TJ
for the 2 indicators, Max bars back set to auto detect
the first indicator is display from barnumber 7
and the second indicator from barnumber 205

Nuno

probably you did, but doesn't hurt asking...
Have you checked to make sure both indicators are scaled to the instrument?

When you click and hold the cursor at the last bar, the hint window should pop up.
What do values you see on the indicators?

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

### Re: 2 indicators have the "same" code but not same value ???

TJ

Both indicators are scaled to the instrument

When you click and hold the cursor at the last bar, the hint window should pop up.
What do values you see on the indicators?

Values are differents

Nuno

TJ
Posts: 7151
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 988 times
Been thanked: 2041 times

### Re: 2 indicators have the "same" code but not same value ???

nuno-online wrote:TJ

Both indicators are scaled to the instrument

When you click and hold the cursor at the last bar, the hint window should pop up.
What do values you see on the indicators?

Values are differents

Nuno

if the values are different,
the problem is in your indicators.

Please check your code again. I am sure they are different from those you posted in this thread, because I have applied them to my MultiCharts, and the values are the same.

If you still can't pinpoint the problem, you have to go to online chat and let Technical Support examine at your computer.
These users thanked the author TJ for the post:
nuno-online

nuno-online
Posts: 174
Joined: 31 Jan 2006
Has thanked: 74 times
Been thanked: 5 times

### Re: 2 indicators have the "same" code but not same value ???

TJ

thank you
I will contact the Technical Support

Nuno