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

 
Before sorting, add if(N==0) return; the function works correctly.
 
How to call (start) another MQL4 EA from one MQL4 EA (no source code compiled in MQL4) and if necessary force it (another EA from the first one) to stop ? Interaction between them through global variables is excluded.
 
Yan Barmin:
How to call (start) another MQL4 EA from one MQL4 EA (no source code compiled in MQL4) and if necessary force it (another EA from the first one) to stop ? The interaction of global variables between them is excluded.

1. open the chart of the desired pair and apply the template with the EA without source code.

2. Apply the template without the EA.

 
Alexey Viktorov:

1. open the chart of the desired pair and apply the template with the EA without source.

2. Apply the template without the EA.

You did not understand the question - it is necessary to call from the code of one EA to another compiled EA, which is (or is not) hovering on the chart. For indicators, there is such a possibility, but for Expert Advisors? Let me explain. If I trade with my EA, the situations appear in the market, which are well worked out by another EA (its author and source code are long gone), how to call it from my EA in MQL4 and close the situation when it works out? The answers are clear, why re-invent the wheel, if it is already there, I just need to call it, wait for the situation to work out and then stop. If necessary, repeat the procedure again.
 
Yan Barmin:
You did not understand the question - you need to call from the code of one EA to another compiled EA already hovering (or not) on the chart. For indicators, it is possible, but for expert advisors?

And there is no such feature built in for the EA. So see here..:

Forum on trading, automated trading systems and strategy testing

Any questions from newbies on MQL4, help and discussion on algorithms and codes

Alexey Viktorov, 2018.09.08 08:57

1. Open the chart of the desired pair and apply the template with the EA without source.

2. To apply a template without the Expert Advisor.


 
Artyom Trishkin:

And there is no such feature built in for the EA. So see..:


I'll give it a try. Thank you.
 
Yan Barmin:
I will try. Thank you.

You haven't said anything specific, so Alexei has only given you a possible course of action. But it looks like you need to exchange data between the two EAs. Just running the second EA in a new window will not help if it is in closed code.

 
Yan Barmin:
I will give it a try. Thank you.

Write the indicator and the conditions in the indicator and drop it onto the chart:

if(рыночная ситуация для моего EA == bool)
 ApplyTemplate("имя шаблона1");

if(рыночная ситуация для чужого EA == bool)
 ApplyTemplate("имя шаблона2");

This way the indicator will load the required pre-created template with the EA

Документация по MQL5: Стандартная библиотека / Ценовые графики / ApplyTemplate
Документация по MQL5: Стандартная библиотека / Ценовые графики / ApplyTemplate
  • www.mql5.com
Стандартная библиотека / Ценовые графики / ApplyTemplate - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Vitaly Muzichenko:

Write the indicator and the conditions in the indicator and drop it onto the chart:

This way the indicator will feed the required pre-created template with the EA

bool ?
 
Good afternoon, is it possible to discuss the vision in this thread?
Reason: