[ARCHIVE]Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Can't go anywhere without you - 5. - page 2

 
rigonich:

Where do you check, in the demo or in the tester?


In the tester

and now in the demo...

It's not working.

 
lottamer:


in the tester

and now in the demo...

Doesn't work.


Wait, how do they both show 134, they should show values of the same order as the current price, i.e. 1.3075
 
rigonich:

wait, how can they both show 134, they should show values of the same order as the current price, i.e. 1.3075


that's what they show...I'm struggling with this...print the average values in different EAs....shows values like 134 (on the pound yen) and 1 on the yen. Multiplying by 1000... gives nothing but extra zeros....

in old experts - showing correctly....

in the new ones...mystique....

apparently because the old ones were written BEFORE 12:12:12

and the new ones after....:))

 

The comparison of real numbers should be done by comparing their difference to zero or to some minimum value:

if(NormalizeDouble(Value_1 - Value_2, Digits)>0.5*Point) {

// Code for handling a situation where Value_1 is greater than Value_2

}

 

MA_1 and MA_2 must be of type double.

What is your type?

 
artmedia70:

The comparison of real numbers should be done by comparing their difference to zero or to some minimum value:

if (NormalizeDouble(Value_1 - Value_2, Digits)>0.5*Point) {

// Code for handling a situation where Value_1 is greater than Value_2

}


of course, it would be interesting, if not ...the fact that in OTHER Expert Advisors this stupid comparison (without normalization) of two averages works for me!!!!
 
lottamer:


that's what it shows...I'm struggling with this...print average values in different experts...and ALL show values like 134 (on the pound yen) and 1 on the yen. Multiplying by 1000... gives nothing but extra zeros....


Try to print the values in a separate script, if it's the same, try reinstalling the terminal, or copy the indicator files from another terminal where they work.
 
lottamer:

it would certainly be interesting, if not ...the fact that in OTHER EAs this same dumb comparison (without normalisation) of two averages works for me!!!!
Show all code
 
lottamer:


that's what they show...i'm struggling with this...i'm printing average values in different experts....show values like 134 (on the pound yen) and 1 on the yen. Multiplying by 1000... gives nothing but extra zeros....


MA_1 and MA_2 should be of type double

Check.

 
rigonich:

Try printing the values in a separate script, if the same thing happens, try reinstalling the terminal, or copying the indicator files from another terminal where they work.
Yes, they told you right above, if the variables are of int type they will print 1 for euras, because converting 1 .3075 to int type gives 1, and you probably print your variables and not the values of the averages.