Questions from Beginners MQL5 MT5 MetaTrader 5 - page 776

 
Alexey Viktorov:
From the documentation



Will this code compile, won't x=i; get an error?

And, what's the difference between declaring these x y z at the beginning, during initialization?

I'm so dumb... ...don't understand shit.

 
Aleksey Vyazmikin:

Maybe the basics, no arguments, I just can't get into the code, where it starts, where it ends... hence the questions. Ok it's a reference(?), but to what?

Where did the"Str" variable originally appear here?

Right after the first curly opening bracket.
 
Artyom Trishkin:
Right after the first curly opening bracket.

OK, we declared all the variables in the parentheses, and started filling them in the function. We filled them in. But, what is the point of these actions, why can't we declare variables before the function and assign values to variables in the function? Is there some kind of trick here?

 
Aleksey Vyazmikin:

OK, we declared all the variables in the parentheses, and started filling them in the function. We filled them in. But, what is the point of these actions, why can't we declare variables before the function and assign values to variables in the function? Is there some kind of trick here?

Why make them global, if they are only needed locally - in this function? Their task has been accomplished and they are destroyed when the function exits.
 
Aleksey Vyazmikin:

Will this code compile, won't x=i; get an error?

And, what's the difference between declaring these x y z at the beginning, during initialization?

I'm so dumb... ...don't know shit.

Maybe it will be cursed, but that's from the documentation without any changes.

 
Artyom Trishkin:
But why make them global, if they are only needed locally - in this function? They have done their task and are destroyed on exiting the function.

I apologize, perhaps, for naive questions, but then why not initialize them in the function? I understand that I will have 33 parameters instead of 3, so I'm wondering how to write it in a more compact way and I can't do it without understanding the code...

Here's where this function is called:

double OnTester()
{
  string Str;
  MqlTick Ticks[];
  double Balance;
  
  GetData(Str, Ticks, Balance); // Подготовка данных для записи

  if (MQLInfoInteger(MQL_OPTIMIZATION)) // Оптимизация
  {
    CONTAINER<uchar> Container; // https://www.mql5.com/ru/forum/95447/page4#comment_5464205
    
    Container[0] = Str;
    Container[1] = Ticks;
    Container[2] = Balance;
  
    FrameAdd(NULL, 0, 0, Container.Data); // Отправили данные из Агента на Терминал
  }
  else // Одиночный прогон
  {    
    if (handle != INVALID_HANDLE)
      SaveData(Str, Ticks, Balance); // Данные будут записаны в MQL5\Files-папку Агента (не Терминала)
    
    FileClose(handle);
  }
  
  return(0);
}

And here we go again to initializing the same :

  string Str;
  MqlTick Ticks[];
  double Balance;
Then theGetData(Str, Ticks, Balance) function is called.
 

Hi. I have a couple of questions about MQL5 Cloud Network:
- for optimization to be possible in MQL5 Cloud Network, should the indicator code be in the EA or can it be called via icustom ?
- if an EA uses data from an external file in its calculations, will it work during optimization, all these files will be loaded into agents ?
- how safe is it to use the agents, can we get/extract EA and the processed data from the agent ?

 
ax237b:

Hi. I have a couple of questions about MQL5 Cloud Network:
- in order to be optimised in MQL5 Cloud Network the indicator code should be in the Expert Advisor or can it be called via icustom ?
- if an EA uses data from an external file in its calculations, will it work during optimization, all these files will be loaded into agents ?
- how safe is it to use the agents, can we get/extract EA and the processed data from the agent ?


- No - indicators are transmitted

- No (data must be transmitted/attached separately)

- Not excluded.

 
Aleksey Vyazmikin:

- No - indicators are transmitted

- No (data must be transmitted/attached separately)

- Not ruled out.

understood, thanks.


another question to the community, are there any working examples of opencl ? not spherical drawing graphs and pi calculations, but for example we have a farm of video cards with several hundred processors, how to run optimization tester runs on each video card processor ? is that even possible ?

 
ax237b:

I see, thank you.


I have another question to the community, are there any working examples of opencl ? not spherical drawing charts and calculating pi number but for example we have a farm of video cards with several hundred processors, how to run optimisation tester on each video card processor ? is it even possible ?


Can you write a kernel for OpenCL? I know of only one person here who claims to use OpenCL to optimise on the fly - while the EA is running. I am not aware of any other examples.

I would like to take a look at them myself. I even asked to publish an article on this subject but the administration does not know how to apply it to real trading.