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

 
imux:
There is a TimeCurrent() function that turns the current time into seconds since 1970. Is there a function that turns these seconds (int) back into datetime? Or you need to separately parse seconds, minutes, hours...? Thank you.

ahem. you don't understand what datetime is probably. it's an int. it's the number of seconds since 1970.

what are you going to turn into and what? int into int ?

 
Imux must have wanted the TimeToStr() function.
 

or confused TimeCurrent with StrToTime.

figure it out

 

int Timm = TimeCurrent(); //Alert (Timm); I get 1306360846.

Timm=Timm+600; // I add 10 min. and now I need to go back to datetime, but don't know how. Thanks.

 
KONDOR:
Look at TP and SL for a start. What and where to change depends on the logic of the Expert Advisor. For example TP and SL may be expressed not in points, but in percentage of deposit or price and it won't depend on the number of digits of brokerage companies.
Please see here an open code of this EA, maybe you can correct it...
 

what does datetime have to do with it... TimeCurrent simply returns the number of seconds since Christmas...:-))

that's how you do it... it's not datetime, it's just int...

 
imux:

Change
a little bit

datetime Timm = TimeCurrent(); //Alert (Timm); I get 130636084.

Timm=Timm+600; // I add 10 min. and now I need to go back to datetime.

 
rensbit:
The Point variable usually helps
There is this variable ..... I will ask you to please look at the code too, what is wrong? On four digits it works, on five it is gibberish
 
Bihkul:
с чего Вы взяли, что советник не работает на пятизнаке?
 double fPointX()
 {
   double PointX = 0;
   if(Digits==5 || Digits==3) 
     {
      PointX = Point * 10;
     }
   if(Digits==4 || Digits==2) 
     {
      PointX = Point;
     }
   return(PointX);
 }
 
KONDOR:


Here's the test schedule on the 4-digit

and this is on five.

Reason: