Download MetaTrader 5

converting datetime to double

To add comments, please log in or register
Interested in traders' opinion? Arrange a poll on the Forum!
Yochanan Gerbi
608
Yochanan Gerbi 2010.12.26 09:59 

Hello freinds,

 

How do I convert datetime to double?

I tried to do:

StringToDouble(IntegerToString(...    but I got  

'StringToDouble' - '{' beginning bracket is expected

Can somebody help. 

 

Thanks 

Andriy Moraru
1160
Andriy Moraru 2010.12.26 13:34  

Why would you want to convert datetime to double? Anyway, AFAIK, there's not problem in doing that directly:

datetime dt;
double d;
d = (double)dt;
Yochanan Gerbi
608
Yochanan Gerbi 2010.12.26 14:43  
enivid:

Why would you want to convert datetime to double? Anyway, AFAIK, there's not problem in doing that directly:

Thanks, But maybe you mean: d = double(dt) ?

and I will explain my desire. I have at MQL4:

      datetime TimeArray[];
      ArrayCopySeriesMQL4(TimeArray ,SYMBOL_TIME ,NULL,TimeFrame);
      
But since the first variance of ArrarCopySeriesMQL4 has to be a double, I did:

    double   tfff[];

   datetime TimeArray[];
   tfff = double(TimeArray);
      
   ArrayCopySeriesMQL4(tfff ,SYMBOL_TIME ,NULL,TimeFrame); 

But the compiler says:

'tfff' - array access error

Can you help?

 

Thanks.
 

 

Andriy Moraru
1160
Andriy Moraru 2010.12.27 19:08  

Why do you need these lines?

   datetime TimeArray[];
   tfff = double(TimeArray);
Just use your double tfff[] to receive your timeseries.
Yochanan Gerbi
608
Yochanan Gerbi 2010.12.27 21:07  
enivid:

Why do you need these lines?

Just use your double tfff[] to receive your timeseries.
thank you. It works
To add comments, please log in or register