Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1553

 
законопослушный гражданин:

If owls are switched off, then before they are switched off they close all open orders, regardless of whether they are in profit or loss,

The indicator that gives the signals to open was RSI, but I assume that it has been cleared.

Indicator that gives a signal to open, in the example was RSI but I assume to test three different owls on different indicators.

So if I will have a sample code for the above logic, I hope I will be able to rework the codes of other EAs, they are open source and available for free.

Maxim is right, you'd better not use closing of orders before the shutdown.

I will try to help

 

To be honest, I don't even know if this is physically possible (closing orders when shutting down).

The EA has been flagged as 'off' and is unlikely to accept trade orders, let alone a pack.

Although, you are welcome to try.

 
Maxim Kuznetsov:

To be honest, I don't even know if this is physically possible (closing orders when shutting down).

The EA has been flagged as 'off' and is unlikely to accept trade orders, let alone a pack.

However, you may try it.

i am currently testing two owls. one is trading the second one switches off the first one when profit and loss of the deposit are achieved (not at take and stop)

So the second one simply closes everything and pushes the auto-trading button. so anything is possible!

here it is:

Files:
 
MakarFX:

Maxim is right, you'd better not use closing orders before shutting down.

I will try to help.

thanks

whatever you say.

in the supposed owl tS, they open trades one by one, one after the other. i.e. the next one opens after the previous one is closed. thus, there is always one trade for one instrument "in the case".

 
MakarFX:

Maxim is right, you'd better not use closing orders before shutting down.

I will try to help.

In principle, you could close everything manually and then turn off the EA.

 
Hello. How do I calculate the visual length of a line on Canva, taking into account the width of all characters, including spaces, in the easiest way possible?
 

Mihail Matkovskij:
Здравствуйте. Как вычислить визуальную длину строки на Канве, с учетом ширины всех символов, включая пробелы, наиболее простым способом? 

bool  TextSetFont( 
   const string  name,            // имя шрифта или путь к файлу шрифта на диске 
   int           size,            // размер шрифта 
   uint          flags,           // комбинация флагов 
   int           orientation=0    // угол наклона текста 
   );

and then

bool  TextGetSize( 
   const string       text,          // строка текста 
   uint&               width,        // ширина буфера в точках 
   uint&               height        // высота буфера в точках 
   );
 
Alexey Viktorov:

and then...

Thank you! I didn't know MQL had a function for that. Already wanted to create my own. But before that I decided toask on the forum.

 
законопослушный гражданин:

In principle, it is possible to close everything manually and then turn off the Expert Advisor.

I can suggest the option ExpertRemove() when a profit or loss is made

 

Hello.

Can you tell me if it's possible to add a column with comments or explanations in the EA parameters... ???

Thank you.

Files:
11111.png  17 kb
Reason: