voidOnTick()
{
ENUM_TIMEFRAMES timeframe=PERIOD_CURRENT; // Таймфрейм графика (текущий, можно задать нужный)string symbol=Symbol(); // Символ графикаdatetime time_open_curr=0; // Время открытия текущего бараdatetime time_open_next=0; // Время открытия следующего бараint number_next_bar=1; // На сколько баров в будущее рассчитывать время//---
time_open_curr=TimeOpen(symbol,timeframe,0); // Здесь 0 - текущий бар заданного графика//--- Если получили время текущего бара, рассчитаем время следующегоif(time_open_curr>0)
time_open_next=time_open_curr+PeriodSeconds(timeframe)*number_next_bar;
}
//+------------------------------------------------------------------+//| Возвращает время открытия бара shift |//| периода графика timeframe |//| на символе symbol_name |//+------------------------------------------------------------------+datetime TimeOpen(string symbol_name,ENUM_TIMEFRAMES timeframe,int shift)
{
datetime array[]={0};
if(CopyTime(symbol_name,timeframe,shift,1,array)==1) return array[0];
return0;
}
//+------------------------------------------------------------------+
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.
Please advise how to get the opening time of the next bar for the current timeframe? Tried to do
In seconds time, with this knowledge correct your formula.
In seconds time, with this knowledge, correct your formula.
Please advise how to get the opening time of the next bar for the current timeframe? Tried to do
Try Alert(Time[0]+_Period*60); PERIOD_CURRENT is 0, zero, blank, notation of timeframe of the used chart
How do I get the next bar open time for the current timeframe? I tried to do
Shit, I mean with PERIOD_... just one line can't do it
That's it
oops))) ahead of the curve
Time[0]+PeriodSeconds();
Yes, thank you!
You're welcome.
Multi-platform code:
how do I write a function with a variable number of parameters?
how do I write a function with a variable number of parameters?
For example?