MQL Service EA for custom symbol - how to?

 

Hi,

besides EAs and indicators, there is this service-thing. I remember I read somewhere, that such can be used to support custom-symbols. Is this possible?

What I would like to to is to restrict a given symbol, like EURUSD, and then restrict it to specific trading hours, e. g. from 7:00am to 7:00pm - just as an example, so that the bars of time in between are not shown on the chart. 

If, how would this be done? 

Thanx in advance

 
Doerk Hilger: besides EAs and indicators, there is this service-thing. I remember I read somewhere, that such can be used to support custom-symbols. Is this possible? What I would like to to is to restrict a given symbol, like EURUSD, and then restrict it to specific trading hours, e. g. from 7:00am to 7:00pm - just as an example, so that the bars of time in between are not shown on the chart. If, how would this be done? 

Yes, a "MQL5 Service" can be used, and in fact a well known Brazilian Renko custom symbol generator uses a Service for that.

I have also made a few Service based programs myself and quite like it. You do, however, have to approach its design differently to an EA.

It functions much like a Script, but it is not attached to any chart and you can run multiple copies with different parameters and give each instance its own name.

For each named instance, you can start or stop it from the navigator as you wish, and can also automatically restart when you start MetaTrader up if it was initially in the running state when you closed MetaTrader.

 

Thanx Fernando,

do you maybe have an example for that? Probably what I am talking bout, is just a hand full of code-lines ... could imagine that at least. 

I have absolutely no clue and even never saw any example at all in view of this service-thing.

 
Doerk Hilger #: Thanx Fernando, do you maybe have an example for that? Probably what I am talking bout, is just a hand full of code-lines ... could imagine that at least. I have absolutely no clue and even never saw any example at all in view of this service-thing.

Since my own code example was commissioned by I customer, I cannot share it here, so I sent it to you privately.

However, here is a simple example I found in CodeBase. It lacks proper environment management, but it's a starting point for those who have never programmed a "MQL5 Service" before.

Code Base

VPS Trailing Stop Service

Igor Gerasimov, 2023.04.26 08:15

VPS Trailing Stop Service
 

Here is a reference from the Articles section as well ...

Articles

MQL5 Cookbook — Services

Denis Kirichenko, 2023.01.27 13:34

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.
 

@Doerk Hilger I have removed your most recent post and redacted some text from a previous post because it violates forum rules about "solicitation/recruitment". Please read your private messages for more information.

Reason: