Value of teeth comes out as 0.00 ????

 

The value here comes out as 0.00

What am I doing wrong in the iMA ?


Comment("Teeth value (red) is: ",DoubleToStr(iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i),2));


This only happens on GBPJPY

 

maybe you make sure symbol in market watch window else no data...

I not have but insert into market watch window:

btw, just a thot: wat happens you run code on 3,5 broker?

that 2 not gonna give you full price ie, nn.123

better to use Digits one of the eleven predefined variables instead hard coded constants...

int start()
{
  int TeethPeriod=14,i=1;
  Comment("\n  ",TimeToStr(TimeLocal(),7),"\n\n  Teeth value (red) is: ",DoubleToStr(iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i),2));
  return(0);
}

 
SanMiguel wrote >>

The value here comes out as 0.00

What am I doing wrong in the iMA ?

Comment("Teeth value (red) is: ",DoubleToStr(iMA(NULL,0,TeethPeriod,0,MODE_SMMA,PRICE_MEDIAN,i),2));

This only happens on GBPJPY

The code looks OK. Only thing I can think of is that maybe your "TeethPeriod" or "i" variables have bad values...? You might use a Print statement to check out what they are when this command is executed.

- Tovan

Reason: