Errors, bugs, questions - page 80

 
maryan.dirtyn:
Thank you. and if you can do the same for Time[0]
datetime Time(int ps)
{
datetime ren[1]={0};
CopyTime(Symbol(),PERIOD_CURRENT,ps,1,ren); 
return(ren[0]); 
}
 
gumgum:

and thanks again. and if you can, you need aPeriod() value like in mql4

Period()
 
maryan.dirtyn:

and thanks again. and if you can, you need a Period() value like in mql4

a.... what does it do?
 
gumgum:
a.... what does it do?
Returns the period of the current chart in minutes... on minutes 1, on hour 60 ... on a day of 1,400.
 
maryan.dirtyn:

and thanks again. and if you can, you need a Period() value like in mql4

I am just passing by, may God forgive me. gumgum

datetime Time(int i){datetime r[1]; CopyTime(Symbol(),PERIOD_CURRENT,i,1,r); return(r[0]);}
double  Close(int i){double  r[1]; CopyClose(Symbol(),PERIOD_CURRENT,i,1,r); return(r[0]);}
double  Open (int i){double  r[1]; CopyOpen (Symbol(),PERIOD_CURRENT,i,1,r); return(r[0]);}
double  High (int i){double  r[1]; CopyHigh (Symbol(),PERIOD_CURRENT,i,1,r); return(r[0]);}
double  Low  (int i){double  r[1]; CopyLow  (Symbol(),PERIOD_CURRENT,i,1,r); return(r[0]);}
//+------------------------------------------------------------------+
datetime Time(int i,ENUM_TIMEFRAMES  tf){datetime r[1]; CopyTime(Symbol(),tf,i,1,r); return(r[0]);}
double  Close(int i,ENUM_TIMEFRAMES  tf){double  r[1]; CopyClose(Symbol(),tf,i,1,r); return(r[0]);}
double  Open (int i,ENUM_TIMEFRAMES  tf){double  r[1]; CopyOpen (Symbol(),tf,i,1,r); return(r[0]);}
double  High (int i,ENUM_TIMEFRAMES  tf){double  r[1]; CopyHigh (Symbol(),tf,i,1,r); return(r[0]);}
double  Low  (int i,ENUM_TIMEFRAMES  tf){double  r[1]; CopyLow  (Symbol(),tf,i,1,r); return(r[0]);}
//+------------------------------------------------------------------+
/*
ENUM_TIMEFRAMES
Идентификатор   Описание
PERIOD_CURRENT  Текущий период
PERIOD_M1       1 минута
PERIOD_M2       2 минуты
PERIOD_M3       3 минуты
PERIOD_M4       4 минуты
PERIOD_M5       5 минут
PERIOD_M6       6 минут
PERIOD_M10      10 минут
PERIOD_M12      12 минут
PERIOD_M15      15 минут
PERIOD_M20      20 минут
PERIOD_M30      30 минут
PERIOD_H1       1 час
PERIOD_H2       2 часа
PERIOD_H3       3 часа
PERIOD_H4       4 часа
PERIOD_H6       6 часов
PERIOD_H8       8 часов
PERIOD_H12      12 часов
PERIOD_D1       1 день
PERIOD_W1       1 неделя
PERIOD_MN1      1 месяц
*/
 
Urain:

Just passing by to help, if you'll forgive me. gumgum

Thank God, I was starting to panic. :)
 

The call can be made with specifying the period, then the value of the specified TF will be returned,

or without indication of period - respectively the value will be from current one

Print("Close[",12,"]=",Close(12),"   Close[",bar,", M10]=",Close(bar,PERIOD_M10));
by :o)
 
Urain:

Just passing by to help, if you'll forgive me. gumgum

hallelujah... now that's a deal))))
 
maryan.dirtyn:
hallelujah... now that's a deal)))) I wish I could return it somehow))
How do you return it in what form? string or int
 
Urain:
How is it in what form ? string or int
int
Reason: