Errors, bugs, questions - page 2299

 
Vladislav Andruschenko:
Guys. Has anyone figured out how to find out if the terminal is loaded on vps MetaQuotes?
When migrating to a wpc, the auto-trade button is disabled. I want to pull this out with the code.?
Not to mislead that the auto-trading button is disabled because the EA is migrated to the VPS.

Most likely some functionality of the VPS is cut, compared to the Desktop version. It is necessary to write some kind of Unit-Test, where they create/delete OBJ_CHART, make ChartNavigate, take PROGRAM_PATH and so on. Record results of all actions in a file. And then compare the Desktop and VPS files. Differences and will show how to determine VPS.

 
fxsaber:

Most likely, some functionality of VPS is cut, compared to Desktop version. It is necessary to write some kind of Unit-Test, where, for example, OBJ_CHART is created/deleted, ChartNavigate is done, PROGRAM_PATH is taken, etc. Record results of all actions in a file. And then compare the Desktop and VPS files. The differences and will show how to define VPS.

No, no, that's not what I mean.
I think we should create a separate get variable about running a vps because unprepared users have a lot of questions:
They put an EA on the vps, it migrates. The auto-trade button is disabled and the smiley is sad.
In my case, it also displays a message that the EA does not work.

And the user tries to press the auto-trade button. And then writes questions in my personal message whether the EA is working or not.
 
Vladislav Andruschenko:
No no no, that's not what I mean.
I think we should create a separate get variable about the vps running because the untrained user has a lot of questions:
They put an EA on the vps, it migrates. The auto-trade button is disabled and the smiley is sad.
In my case, it also displays a message that the EA does not work.

And the user tries to push the autotrade button and then writes questions in his or her personal message whether the EA is working or not.

Let the Expert Advisor on the VPS show the user that it is enabled - post a fake pending order with an appropriate comment.

 
fxsaber:

Have the EA on the VPS show the user that it is on - put up a fake pending order with an appropriate comment.

That's a thought.
I will dig in that direction.
 
SuhanovDM94:
Good afternoon, all. Does anyone know if it is possible to run a tester from an EA? I want to use statistical data in Expert Advisor logic.
Maybe MT5 has an open API, and it is possible to do it with it? Please advise me, at least in what direction to dig?
 

How can I make my function accept an arbitrary number of parameters of any type, like Print() and FileWrite()?

I do not suggest overloading, it is hundreds of parameter combinations.

I am more interested in how it is implemented in Print() and FileWrite().

 
secret:

mql has no mechanism for working with an arbitrary number of parameters.

Up to 8 parameters can be handled by templates.

 
TheXpert:

up to 8 parameters are possible via templates.

is there a code example?

 
secret:

is there a code example?

void f() {}

template
<typename T1>
void f(T1 t1) {}

//...

template
<typename T1, typename T2, typename T3, typename T4, typename T5, typename T6, typename T7, typename T8, typename T9>
void f(T1 t1, T2 t2, T3 t3, T4 t4, T5 t5, T6 t6, T7 t7, T8 t8, T9 t9) {}


void OnStart()
{
   f();
   f(1);
   f(1, 1.01, "1", false, 1, 1, 1, 1, 1);
}

With 9 parameters it compiled too, there used to be a limit of 8 parameters, now I don't know.

All combinations are taken over by the template, so for 9 parameters we need 10 function overloads.

 

Please make the Start button in the Tester a different colour in the case of a single run, and a different colour in the case of Optimisation.

To remove the factor of randomly starting Optimisation instead of a single run.