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

Questions about MultiCharts and user contributed studies.
nuno-online
Posts: 166
Joined: 31 Jan 2006
Has thanked: 72 times
Been thanked: 3 times

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

Postby nuno-online » 21 Aug 2011

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)

thank you for your help
nuno
Attachments
Same indicators.png
Same indicators.png (49.67 KiB) Viewed 135 times

User avatar
TJ
Posts: 6572
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 968 times
Been thanked: 1902 times

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

Postby TJ » 21 Aug 2011

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.
download/file.php?id=3820

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

thank you for your help
nuno

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

Image
Attachments
maxbarsback.gif
maxbarsback.gif (18.14 KiB) Viewed 196 times
uno test.png
uno test.png (116.96 KiB) Viewed 136 times

nuno-online
Posts: 166
Joined: 31 Jan 2006
Has thanked: 72 times
Been thanked: 3 times

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

Postby nuno-online » 21 Aug 2011

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

User avatar
TJ
Posts: 6572
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 968 times
Been thanked: 1902 times

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

Postby TJ » 21 Aug 2011

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: 166
Joined: 31 Jan 2006
Has thanked: 72 times
Been thanked: 3 times

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

Postby nuno-online » 22 Aug 2011

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

User avatar
TJ
Posts: 6572
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 968 times
Been thanked: 1902 times

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

Postby TJ » 22 Aug 2011

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: 166
Joined: 31 Jan 2006
Has thanked: 72 times
Been thanked: 3 times

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

Postby nuno-online » 24 Aug 2011

TJ

thank you
I will contact the Technical Support

Nuno


Return to “MultiCharts”