Is it possible to distinguish a manually created graphical object from an object created by an indicator or EA?
In the function
OBJPROP_HIDDEN
Barring the name of a graphical object from the terminal menu "Charts" - "Objects" - "List of Objects". The value true allows to hide an unnecessary object from the list. By default true is set for objects that display calendar events, trading history, as well asthose created from MQL5 program. To see suchgraphical objects and access their properties, click "All" in the "List of Objects" window.
Все объекты, используемые в техническом анализе, имеют привязку на графиках по координатам цены и времени – трендовая линия, каналы, инструменты Фибоначчи и т.д. Но есть ряд вспомогательных объектов, предназначенных для улучшения интерфейса, которые имеют привязку к видимой всегда части графика (основное окно графика или подокна индикаторов...
Не следует путать между собой ордера из торговой истории и действующие отложенные ордера, которые отображаются на вкладке "Торговля" в панели "Инструменты". Список ордеров, которые были отменены или привели к проведению торговой операции, можно посмотреть в закладке "История" на панели "Инструменты" клиентского терминала. Функция...
It was necessary to find out inside one mqh whether something was called before from another mqh. The mqh is not aware of each other's presence. One of them may be in and one of them may not.
All in all, the problem is unusual (for me). Solved it in a rather crutchy way.
void f1()
{
SetUserError(0);
}
void f2()
{
if(_LastError == ERR_USER_ERROR_FIRST)Print("f1() была вызвана.");
elsePrint("f1() не была вызвана");
}
voidOnStart()
{
f1();
f2();
}
It was necessary to find out inside one mqh whether something was called before from another mqh. The mqh is not aware of each other's presence. One of them may be in and one of them may not.
All in all, the problem is unusual (for me). Solved it in a rather crutchy way.
I think it's very bad practice, but it works.
Using _LastError has one unsolvable problem, when connecting third-party libraries, there is a non-zero probability of collision of user error codes. As an alternative to maintain your own lastError. Either a global variable, wrapped in includeguard in all mqh, or a single variable.
PS. The Sleep() function in MQL5 is not a redirect to win api function ::Sleep(). To be more exact, if the value is less than 100, it is a redirect. But above 100 it is a loop with win api slip inside it so that it can be interrupted by IsStopped.
There is one more subtle point. If milliseconds <=0, we prepend 1. That is, we never call ::Sleep(0).
It has been forgotten already. True only for MT5. In MT4 Sleep(0) can suspend the terminal.
The typedef variant loses by a factor of three. I refused to use it where it is crucial. For example, for TC the same OrdersTotal is called at least once at every tick of optimizer pass.
In debug mode the situation is reversed. So, it makes sense to use typedef in MT4 for acceleration.
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.
Is it possible to distinguish a manually created graphical object from an object created by an indicator or EA?
In the function
OBJPROP_HIDDEN
Barring the name of a graphical object from the terminal menu "Charts" - "Objects" - "List of Objects". The value true allows to hide an unnecessary object from the list. By default true is set for objects that display calendar events, trading history, as well asthose created from MQL5 program. To see suchgraphical objects and access their properties, click "All" in the "List of Objects" window.
bool
Forum on trading, automated trading systems and testing trading strategies
Libraries: Expert
fxsaber, 2020.10.09 04:55
I have highlighted an important place in the code. Without it there is no application of the pattern until the end of the script.
Forum on trading, automated trading systems and trading strategy testing
MT5 and Speed in Action
Anton, 2020.10.08 11:00
Different meaning and different execution mechanism. 0 - event in queue of "own" chart. -1 - event in its own queue.
At the end of the week my head is already not good.
I have a ticket of an open position on a hedge in mt5 e.g. 123456
I want to calculate a profit after the position is closed, and I cannot do it.
I do so, but I get only commission...
How do I get the profit of a closed position with a ticket?
Try to better select trades using HistorySelectByPosition().
It was necessary to find out inside one mqh whether something was called before from another mqh. The mqh is not aware of each other's presence. One of them may be in and one of them may not.
All in all, the problem is unusual (for me). Solved it in a rather crutchy way.
I think it's very bad practice, but it works.
It was necessary to find out inside one mqh whether something was called before from another mqh. The mqh is not aware of each other's presence. One of them may be in and one of them may not.
All in all, the problem is unusual (for me). Solved it in a rather crutchy way.
I think it's very bad practice, but it works.
Forum on trading, automated trading systems and trading strategy testing
MT5 and Speed in Action
fxsaber, 2020.10.20 12:28
Intermediate summary for a fast unloaded machine.
The relevance of price data is very ambiguous for those who trade using bars and indicators.
Ticks and tumblers are hard to be in real time.
Forum on trading, automated trading systems and trading strategies testing
Peculiarities of mql5, tips and tricks
Slava, 2018.09.20 15:40
PS. The Sleep() function in MQL5 is not a redirect to win api function ::Sleep(). To be more exact, if the value is less than 100, it is a redirect. But above 100 it is a loop with win api slip inside it so that it can be interrupted by IsStopped.
There is one more subtle point. If milliseconds <=0, we prepend 1. That is, we never call ::Sleep(0).
It has been forgotten already. True only for MT5. In MT4 Sleep(0) can suspend the terminal.
But I decided to compare performance first, using a simple example.
The result.
The typedef variant loses by a factor of three. I refused to use it where it is crucial. For example, for TC the same OrdersTotal is called at least once at every tick of optimizer pass.
In debug mode the situation is reversed. So, it makes sense to use typedef in MT4 for acceleration.