New article TradeObjects: Automation of trading based on MetaTrader graphical objects has been published:
Geometrical constructions on symbol charts have been remaining
one of the most popular trading tools for decades. The advanced
technologies make it easier to apply support or resistance lines,
historical price levels and entire patterns, for example channels and
Fibo grid. Algorithmic trading software allows us both to analyze
standard patterns and trade using them. MetaTrader also has applications
that automate the process to some extent: in most cases, it is enough
to add an object to the chart with an EA or script launched in it. The
application will open a position, track and close it in due time
according to the settings. Such applications enable us not only to trade
online but also polish our skills in the tester's visualization mode.
We can find such applications in the CodeBase and the Market.
However, all is not that simple. Generally, CodeBase applications
have simplified functionality. Besides, they are rarely updated and
become obsolete fast (often losing compatibility with the latest MQL
language and platform versions), while commercial products are often too
In this article, we will develop a new tool that represents the
golden mean. It will be as simple as possible and provide ample
opportunities at the same time. It will be compatible with both
MetaTrader 4 and MetaTrader 5. Thanks to the open source code, it can
easily be expanded and modified to fit your needs.
Author: Stanislav Korotky
Hi there, thanks for this great work.
I´ve read the paper, but at MT5 I´m facing the following compile error.
'SymbolInfoInteger' - no one of the overloads can be applied to the function call mt4market.mqh 101 23
I´m struggling to fix the problem, could you please give me some advice?
Sorry for the inconvenience.
Unfortunately MetaTrader 5 API have been changed in incompatible way since the publication.
Previously, to detect if a symbol supports "close by" mode one should use SymbolInfoInteger(symbol, SYMBOL_ORDER_CLOSEBY), which returned boolean value.
Now it's replaced by the new approach: you should call SymbolInfoInteger(_Symbol, SYMBOL_ORDER_MODE), which returns a combination of flags, one of which is SYMBOL_ORDER_CLOSEBY.
(SymbolInfoInteger(_Symbol, SYMBOL_ORDER_MODE) & SYMBOL_ORDER_CLOSEBY != 0)
The updated header file is attached.