converting datetime to double

 

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 

 

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;
 
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.
 

 

Why do you need these lines?

   datetime TimeArray[];
   tfff = double(TimeArray);
Just use your double tfff[] to receive your timeseries.
 
enivid:

Why do you need these lines?

Just use your double tfff[] to receive your timeseries.
thank you. It works
Reason: