Libraries: Expert - page 12

 
If the Expert Advisor requires loading a DLL, it does not tick this checkbox itself? It's about expertmode, it seems. I don't see the interface. Do I need to edit the code or the template myself?
 
traveller00:
If the Expert Advisor requires loading a DLL, it does not tick this checkbox itself? It's about expertmode, it seems. I don't see the interface. Do I need to edit the code or the template myself?

There were examples with DLL above.

 

I would like to clarify the semantics of the Parameters method return code. Right now, when there is an error receiving a string with a template, the method returns 0. This assumes that 0 means an error.

In all other cases, the return is a string:

Res = (int)EXPERT::StringBetween(Str, EXPERT_FLAGS, STRING_END);

, i.e. the value of expertmode from the template gets there, which can be equal to 0 quite legally. EXPERT is used this way in other projects, in particular in Tester:

void OnTimerReal()
{
  ...
  if ((this.Symb += BeginTick) && EXPERT::Parameters(0, Params, Names))
  {
    ... открытие рабочего чарта
  }
}

As a result, if the method returns 0, Tester does not work. Why? If the real trading flag is reset, it doesn't mean that testing should be forbidden, imho. Moreover, Tester does nothing silently in this case.

 
Stanislav Korotky:

I would like to clarify the semantics of the Parameters method return code. Currently, when there is an error receiving a string with a template, the method returns 0. This assumes that 0 means an error.

The return value has changed since the first publications. So historically, the return value has historically turned out to say nothing about whether there is an error there or not.

In all other cases, the return value is a string:

, i.e. the expertmode value from the template gets there, which can be equal to 0 quite legally. In other projects, in particular in Tester, EXPERT is used in this way :

As a result, if the method returns 0, Tester does not work. Why? If the real trading flag is reset, it doesn't mean that testing should be forbidden, imho. Especially, Tester does not do anything silently in this case.

According to the code you cited, indeed, it won't work if autotrading is disabled. I don't remember whether it is a mistake or done on purpose. Most likely, it was done on purpose so that it was possible to connect DLLs.


ZЫ I will have to update the bible. There is a strong twist for sharing with Sequence. Since only I need this feature, it is not a priority to update it.

 

The only time the infinite loop detection construct worked.

ME      3       15:22:12.123    Message Endless loop:
KS      3       15:22:12.123    Message Expert.mqh
IP      3       15:22:12.123    Message 169
DG      3       15:22:12.123    Message bool EXPERT::TemplateApply(const long,const string&,const bool)
FQ      3       15:22:12.123    Message Condition: !::IsStopped()&&::ChartGetInteger(Chart_ID,CHART_COLOR_STOP_LEVEL,0,Value)&&(!(bool)((int)Value>>24))


It happened in Expert.mqh at this point.

      while (_CS(!::IsStopped() && ::ChartGetInteger(Chart_ID, CHART_COLOR_STOP_LEVEL, 0, Value) && (!(bool)((int)Value >> 24))))
        ::Sleep(1); // https://www.mql5.com/ru/forum/170952/page190#comment_18830346


I actively use Expert.mqh every day, but this is the first time I ran into it. Apparently there is some very rare situation. Keep in mind.

 
Nice work, but I guess right now it will load the Expert with the default preset? It would also be good if you could load SET files for the chosen expert
 

Hi, thank you EXPER.mqh is amazing.

1. how can I activate "Algo trading" for EA opened with EXPERT::Run(....).

2. I am using the 2019 version. Is there a newer version?

 
upinsa #:

1. How can I activate "Algo trading" for EA opened with EXPERT::Run(....)

Read this.

2. I am using the 2019 version. Is there a newer version?

Last version.


 
static bool GetInputNames( MqlParam &Parameters[], string &InputNames[] )
  {
    const int Size = ::ArraySize(Parameters);
    bool Res = (Size > 1);

    if (Res)
    {
      ::ArrayResize(InputNames, Size - 1);

      for (int i = 1; (i < Size) && Res; i++)
      {
        InputNames[i - 1] = EXPERT::GetInputName(Parameters[i]);
        Res &= (InputNames[i - 1] != NULL);
      }
    }

    return(Res);
  }

input group "【label1】";

This situation doesn't seem to be considered. When the parameter is a group, there is no specific value, and the received value will be null, so the parameters after the group will not be received.

 
hini #:

input group "【label1】";

This situation doesn't seem to be considered. When the parameter is a group, there is no specific value, and the received value will be null, so the parameters after the group will not be received.

If there is a problem, please give ready mq5 files to reproduce.