int limit;
int counted_bars = IndicatorCounted();
//---- последний посчитанный бар будет пересчитанif(counted_bars > 0)
counted_bars--;
limit = Bars - counted_bars - 1;
if (limit > maxBars) limit=maxBars;
//---- основной циклfor( i = limit; i >= 0; i--)
{
b[i]=High[i+1];
}
when the previous high is queried like this, can the indicator redraw?
Cmu4: Gentlemen, where can I find the source code for the Hour() and Day () functions???
// 1.5.5. Метод возвращает час (0, 1, 2, ..., 23) для указанного времени.template <typename Type1, typename Type2> // Рекомендуемые типы для Type1: WORD, DWORD. Рекомендуемые типы для Type2: int, long, __int64, __time32_t, __time64_t.static Type1 Hour(const Type2 t2Time) // Дата, представленная в виде количества секунд, прошедших после 00:00 1 января 1970 года.
{
return(Type1(GetGMT(t2Time).tm_hour)); // Возвращаем результат.
}
// 1.5.1. Метод возвращает день месяца (1 - 31) для указанного времени.template <typename Type1, typename Type2> // Рекомендуемые типы для Type1: WORD, DWORD. Рекомендуемые типы для Type2: int, long, __int64, __time32_t, __time64_t.static Type1 Day(const Type2 t2Time) // Дата, представленная в виде количества секунд, прошедших после 00:00 1 января 1970 года.
{
return(Type1(GetGMT(t2Time).tm_mday)); // Возвращаем результат.
}
// 1.8.1. Метод возвращает для указанного времени: struct tm {int tm_sec; // Секунды.// int tm_min; // Минуты.// int tm_hour; // Часы.// int tm_mday; // День месяца.// int tm_mon; // Месяц.// int tm_year; // Год.// int tm_wday; // День недели.// int tm_yday; // День года.// int tm_isdst;); // Летнее время.template <typename Type> // Рекомендуемые типы: __time32_t, __time64_t.static tm GetGMT(Type tTime) // Время в виде количества секунд от 01.01.1970 года.
{// Переменные.
__time64_t t64Time(tTime); // Присваиваем и преобразуем тип времени.
DWORD dwError = 0; // Номер ошибки.
tstringstream ssExclusion; // Строка с сообщением об ошибке.// Структуры.struct tm NewTime = {0}; // Структура //----if (::_gmtime64_s(&NewTime, &t64Time) != 0)
{
if (DEBUGGING || DEBUGGING_EXCLUSION)
{
dwError = ::GetLastError();
ssExclusion << std::endl << _T("Ошибка в методе \"Utils::UTime::GetGMT()\".")
<< std::endl << _T("Не заполнена структура \"tm\".")
<< std::endl << Utils::Error::Description(dwError) << std::endl;
if (DEBUGGING) tcout << ssExclusion.str();
if (DEBUGGING_EXCLUSION) throw(ssExclusion.str());
}
}
return(NewTime); // Возвращаем результат.
}
Good afternoon, can you explain where the error is in the loop, it goes around in a circle (endlessly) and nothing helps, I have tried everything. It appears at the moment when the order was processed in the EA, and by tp or sl was deleted.
for.... выборка одного ордера для работы
---
---
l_pos_2 = 0;
l_ord_modif_1 = false;
while (!l_ord_modif_1 && l_pos_2 < 10) {
if (OrderCloseTime() == 0) l_ord_modif_1 = OrderModify(OrderTicket(), OrderOpenPrice(), MarketInfo(Symbol(), MODE_BID) - d_level, MarketInfo(Symbol(), MODE_ASK) + d_level, 0,CLR_NONE);
elsebreak;
l_pos_2++;
}
---
---
}
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.
I have this cycle.
when the previous high is queried like this, can the indicator redraw?
Gentlemen, where can I find the source code for the Hour() and Day () functions???
About this...
About that...
How can I get the opening hour from OrderOpenTime() in order to compare it with the current Hour()?
How can I get the opening hour of a position from OrderOpenTime() in order to compare it with the current Hour()?
Did I get it right?
Good afternoon, can you explain where the error is in the loop, it goes around in a circle (endlessly) and nothing helps, I have tried everything. It appears at the moment when the order was processed in the EA, and by tp or sl was deleted.
MQL5. Multicurrency Expert Advisor.
Profit or loss is calculated for separate currencies normally.
How to account for trades closed by the tester at the end?