ObjectGetInteger
Возвращает значение соответствующего свойства объекта в каком формате?.
Свойство объекта должно быть типов datetime, int, color, bool или char.
A100: It turns out that you should. But you can also ignore warnings, which in some cases is not very convenient
OK.
And ignore is not an option, and error log gets stuffed with anything during compilation, and potentially problematic place - so you have to look for answers :)
//+------------------------------------------------------------------+//| Script program start function |//+------------------------------------------------------------------+voidOnStart()
{
//---int start=5;
int count=2;
datetime _time[];
datetime _timeM1[];
int ntime=CopyTime(_Symbol,_Period,start,count,_time);//узнаем время 5 и 4 бара, нумерация как в тайм серииif(ntime>0)
{
Print("_time[0]=",_time[0]);
Print("_time[1]=",_time[1]);
datetime endtime=_time[1]-PeriodSeconds(PERIOD_M1);
int nM1=CopyTime(_Symbol,PERIOD_M1,_time[0],endtime,_timeM1);//получаем массив содержащий время минуток и число минутокif(nM1>0)
{
Print("Число минуток в период с ",_time[0]," по ",endtime," =",nM1);
}
int nbarsM1=Bars(_Symbol,PERIOD_M1,_time[0],endtime);//проверимся
Print("Число минуток =",nbarsM1);
}
}
//+------------------------------------------------------------------+
You can do that.
And you have a lot of seconds in an hour, as much as 72,000! I wish I had that many in reality )).
In real code, you still need to check the synchronisation of the smaller timeframe.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Silent:
What - K? K is initialised as false. Assigned true along the way. Then we check - if (K). What - K?
Read the docs first.
Understand that a bool in if is not just true/false. For the compiler, anything that is not 0 is true.
https://www.mql5.com/ru/docs/basis/types/integer/boolconst
Read the docs for starters.
Understand that a bool in if is not just true/false. for the compiler, anything that is not 0 is true.
https://www.mql5.com/ru/docs/basis/types/integer/boolconst
Trying to get the time/price of the highlighted trend line
for
I get a warning
But
Question 1: how to convert correctly?
For
I do not get the time of the second line point, but the time of the beginning of the story by the symbol
Question 2: why if
ObjectGetTimeByValue Возвращает значение времени для указанного значения цены указанного объекта.с
I've done all sorts of tricks, deleted and added numbers - I don't get object time.
If you mean the line identifier - how to get it, I can't find the function.
Update
In general, it seems to relate to the indicators, then why is not reflected in the documentation. So then
ObjectGetTimeByValuein the graphical objects section.
Hmm. Got rid of the warning by declaring as long
long TL1_Old_Time,TL2_Old_Time;It should be understood that.
for
TL1_Old_Time=ObjectGetInteger(0,n,OBJPROP_TIME);
I get a warning
possible loss of data due to type conversion
TL1_Old_Time=(datetime)ObjectGetInteger(0,n,OBJPROP_TIME)
such a curve in the language function
TL1_Old_Time=(datetime)ObjectGetInteger(0,n,OBJPROP_TIME)
such a curve in the language function
I.e., you can (and in my case should) specify a conversion for functions?
Thank you.
So, it is possible (and in my case, necessary) to specify a transformation for functions?
It turns out that you should. But you can also ignore warnings, which in some cases is not very convenient
OK.
And ignore is not an option, and error log gets stuffed with anything during compilation, and potentially problematic place - so you have to look for answers :)
I need to get the number of bars of minutes from the high timeframe.
I get an incomprehensible number from Bars. I start it on H1 and get 1201. On M1 I get 6.
Can you tell me where the problem is?
You can do that.
And you have a lot of seconds in an hour, as much as 72,000! I wish I had that many in reality )).
In real code, you still need to check the synchronisation of the smaller timeframe.