Very nice. Thank you for sharing this article and the code examples.
I created a very simple service that identifies when it is a new day and runs a task just once a day to save the trade history in a CSV file. Afterward, this file is updated only with the new trades from the history.
The advantage is that I don't need a chart window to do this, however it raised a question about whether the service will use more or less processing power and memory from my computer compared to if I used this task inside an empty indicator for example, running an 'OnTimer' function.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
New article MQL5 Cookbook — Services has been published:
The article describes the versatile capabilities of services — MQL5 programs that do not require binding graphs. I will also highlight the differences of services from other MQL5 programs and emphasize the nuances of the developer's work with services. As examples, the reader is offered various tasks covering a wide range of functionality that can be implemented as a service.
Let's imagine that we are faced with the following task. The terminal should feature the charts of the currently traded symbols, i.e. the ones featuring open positions.
The rules for open charts are very simple. If there is an open position for one of the symbols, then open the chart of this symbol. If there is no position, there will be no chart. If there are several positions for one symbol, then only one chart will be opened.
Also, let's add some colors. If the position is in profit, then the background color of the chart will be light blue, and if it is in the red, it will be light pink. Zero profit uses the lavender color.
Author: Denis Kirichenko