Why not put the input parameters in the structure? - page 7

 
Dmitry Fedoseev:

Maybe it's because the first post doesn't say it right? That's why everyone writes about their own things. And you can't ask questions - the answer is either ignorance or hysteria.


From whom?

 

No, no, don't be tricky. The question was: how not to show the input parameters of an EA when attaching it to an existing chart by a user? Not via templates.

By the way, it's not clear why this solution requires creating a new chart?

P. S. And in this line there's a "misprint":

  Params[0].string_value = "Experts\\Advisors\E xpertMACD.ex5";
 
Ihor Herasko:

No, no, don't cheat. The question was: how not to show the input parameters of the EA when attaching it to an existing chart by the user? Not via templates.

User runs Expert_loader as if it were an Expert Advisor.

By the way, it's not clear why this solution requires creating a new chart?

Forum on trading, automated trading systems and strategy testing

Libraries: Expert

fxsaber, 2017.09.08 14:45

If you also need to run an EA on the same chart where the script is thrown, then you need to open a new chart and run yourself (the script) on it through a template, and from there run the EA on the chart we need, having closed the auxiliary one. This is done by ExpertLoader_Example.mq5.

On the new chart it's quite simple
// Запуск советника с заданными входными параметрами
#include <fxsaber\Expert.mqh>

void OnStart()
{
  MqlParam Params[2];
  
  // Путь к советнику
  Params[0].string_value = "Experts\\Advisors\\ExpertMACD.ex5";

  // Первый входной параметр советника
  Params[1].type = TYPE_STRING;
  Params[1].string_value = "Hello World!";

  // На новом чарте запускаем советник
  EXPERT::Run(ChartOpen(_Symbol, _Period), Params);
}

P. S. There is a misprint in this line:

Thank you, there is a misprint in the description. The MQL files are ok.