multiplying different variable type

 
Hi, what kind of variable type should I choose, if I want to use combination of variable, for example multiplying x*y      x:(datetime) & y(double)
 
  1. See Typecasting - Data Types - Language Basics - MQL4 Reference
  2. A datetime is an ulong; seconds since 1970. It makes no sense to multiply by anything.
 
William Roeder:
  1. See Typecasting - Data Types - Language Basics - MQL4 Reference
  2. A datetime is an ulong; seconds since 1970. It makes no sense to multiply by anything.

A datetime is 8 bytes, that doesn't mean it's an ulong. It's not.

 
Alain Verleyen:

A datetime is 8 bytes, that doesn't mean it's an ulong. It's not.

William Roeder:
  1. See Typecasting - Data Types - Language Basics - MQL4 Reference
  2. A datetime is an ulong; seconds since 1970. It makes no sense to multiply by anything.
Hi, so, how can we determine slope of a line between two points as p1,p2 (double) and t1,t2(datetime)?
 
337252: Hi, so, how can we determine slope of a line between two points as p1,p2 (double) and t1,t2(datetime)?

You don't. You determine the slope of a line between two coordinates: p1,t1 and p2, t2. m = (p1-p2) ÷ (t1-t2)

 
William Roeder:

You don't. You determine the slope of a line between two coordinates: p1,t1 and p2, t2. m = (p1-p2) ÷ (t1-t2)

I did it, as you said, but it returns value that is not equal by something that is seen visually.(see the attachment)

this is part of code:

   double m=(p2-p1)/(t2-t1);

   double teta_up=(180/M_PI)*MathArctan(m);

and this is output:

p1 = 1.18997

p2 = 1.19087

t1 = 2021.08.04 16:00:00

t2 = 2021.07.30 12:00:00

teta_up = -1.155156845021979e-07

Ps. teta_up on Image is related to red one on the chart.