If during long execution on cold (with upload from server) CopyTicks make order modification, it will happen (not on Server, but in Terminal - OnTradeTransaction) with significant lag.
For example, in normal mode 100 ms, in higher mode - 2000 ms.
Need to learn how to work with ticks sparingly somehow. Not working out.
How to make CopyTicks by nearest ticks fast and not consume hundreds of megabytes?
#property description"Если ваш робот использует тики (таких не встречал!),"#property description"то вы сталкиваетесь либо с тормозами,"#property description"либо с запредельным использованием памяти."#property description"Что не позволит вам спокойно поставить робота на VPS.\n"#property description"Для тех, кто считает возможным для себя участие в деле исправления этого бага,"#property description"просто опубликуйте результат выполнения этого скрипта по ссылке ниже.\n"#property description"https://www.mql5.com/ru/forum/342090/page81#comment_20534660"#property description"Эта ссылка доступна к копировнию в буфер обмена в Журнале (Эксперты)."#include <fxsaber\Benchmark\Benchmark.mqh> // https://www.mql5.com/ru/code/31279constbool Init = EventSetTimer(1);
// Вызывается CopyTicks для каждого символа из Обзора рынка.void CopyTicks_Test()
{
staticMqlTick Ticks[2000];
for (int i = SymbolsTotal(true) - 1; !IsStopped() && (i >= 0); i--)
{
conststring Symb = SymbolName(i, true);
if (!SymbolInfoInteger(Symb, SYMBOL_CUSTOM))
{
CopyTicks(Symb, Ticks, COPY_TICKS_ALL, TimeCurrent() * 1000, 1);
// CopyTicksRange(Symb, Ticks, COPY_TICKS_ALL, TimeCurrent() * 1000);
}
}
}
// Вызывается CopyTicksRange для каждого символа из Обзора рынка.void CopyTicksRange_Test()
{
staticMqlTick Ticks[2000];
for (int i = SymbolsTotal(true) - 1; !IsStopped() && (i >= 0); i--)
{
conststring Symb = SymbolName(i, true);
if (!SymbolInfoInteger(Symb, SYMBOL_CUSTOM))
{
// CopyTicks(Symb, Ticks, COPY_TICKS_ALL, TimeCurrent() * 1000, 1);CopyTicksRange(Symb, Ticks, COPY_TICKS_ALL, TimeCurrent() * 1000);
}
}
}
#define PRINT(A) Print(#A + " = " + (string)(A))
voidOnDeinit( constint )
{
PRINT(SymbolsTotal(true));
PRINT(TerminalInfoInteger(TERMINAL_MEMORY_USED));
Print("https://www.mql5.com/ru/forum/342090/page81#comment_20534660");
}
voidOnTimer()
{
staticint Count = 0;
_BV(CopyTicks_Test(), 1); // Очень много потребляет CPU, выполняется медленно, память не использует.
_BV(CopyTicksRange_Test(), 1); // Очень много потребляет RAM, выполняется быстроComment(TimeCurrent());
if (Count++ > 9)
ExpertRemove();
}
Язык программирования MQL5 позволяет решать задачи на совершенно новом уровне. Даже те задачи, которые уже вроде имеют решения, благодаря объектно-ориентированному программированию могут подняться на качественно новый уровень. В данной статье специально взят простой пример проверки появления нового бара на графике, который был преобразован в достаточно мощный и универсальный инструмент. Какой? Читайте в статье.
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.
If during long execution on cold (with upload from server) CopyTicks make order modification, it will happen (not on Server, but in Terminal - OnTradeTransaction) with significant lag.
For example, in normal mode 100 ms, in higher mode - 2000 ms.
How to make CopyTicks by nearest ticks fast and not consume hundreds of megabytes?
Search string: Oshibka 024.
Need to learn how to work with ticks sparingly somehow. Not working out.
How to make CopyTicks by closest ticks fast and not consume hundreds of megabytes?
Search string: Oshibka 024.
Thank you, the logs show the CopyTicks problem well.
Thanks, the logs show the CopyTicks problem well.
Sab, spy indicator don't you work with it?, i have a lot of questions
Through id, instead of string robot gets working symbol, but today 2 terminals got different status on trades
on M1 in spyro via calculated=, there is a check for a new calculation and then sent to the robot
Sub, spy indicator don't you work with it?, I have a lot of questions
Only under MT4 - in KB lies.
Only under MT4 - in KB lies.
don't look at custom bases, it's for the weak
Forum on trading, automated trading systems and trading strategy testing
MT5 and Speed in Action
Dzmitry Manannikov, 2021.02.05 14:38
If you increase the number of symbols, you'll see the problem of high memory usage.
I don't look at custom bases, it's for the weak.
I won't respond to posts that I don't understand.