Errors, bugs, questions - page 1840

 

Forum on trading, automated trading systems and trading strategy testing

Bugs, bugs, questions

fxsaber, 2017.04.01 10:20

Once upon a time, the operator [] was added to string type.
string Str = "AB C";
Print(CharToString(Str[1])); // B


Is it possible on the developers side to add an = operator for arrays?

int a[], b[];
a = b; // ArrayCopy(a, b);


Since there are no pointers, such an operator would make the language more flexible - found situations where it would be VERY handy.

Same for complex structures
MqlTradeRequest a, b;
a = b;
 
fxsaber:
The same for complex structures
You can write the function Copy(a, b), it looks and works not so nice, but as an option...
 
Комбинатор:
You can write function Copy(a, b), it looks and works not so nice, but it's an option...
This function will not be universal (through template).
 
fxsaber:
Such a function would not be universal (via a template).
You can make an overload for each structure. In the end, of course, it will take a lot of space, not a template, but you can use it universally without any problems
 
Комбинатор:
You could do an overloading for each structure. In the end it will take a lot of space of course, not a template, but you can use it universally without problems

But you know that's not what you were talking about. Universal is when it works not only for regular complex structures, but also for custom complex ones.

ZZY At the moment it's impossible to write such a function

MqlTradeRequest Func();

That's probably not a good limitation of the language.

 
Is it possible to compensate for the absence of pointers to an array by introducing the ability to return an array by a function?
int[] Func()
{
  int a[] = {1, 2, 3};

  return(a);
}

Print(Func()[1]); // 2
 

I don't know if this is the right topic.

Glitch with profiles in MT5 and MT4

When saving profiles, e.g. 6 charts for each pair separately, when I open a profile I often open a different one than the one I need. And the one I need won't open at all.

I thought the problem is in the broker's terminal in MT4 (originally I tried to configure the profiles there), I downloaded the original MT5 from Metaquotes and the same problem.


Where to dig?

 
Oleg:

I don't know if this is the right topic.

Glitch with profiles in МТ5 and МТ4

When saving profiles, e.g. 6 charts for each pair separately, when I open a profile I often open a different one than I need. And the one I need won't open at all.

I thought the problem is in the broker's terminal in MT4 (originally I tried to configure the profiles there), I downloaded the original MT5 from Metaquotes and the same problem.

Where to dig?


To start with a consistent and accurate description. MT5 - build where the data directory is (after reloading take the top three lines from the "Log" tab):

  1. opened so-and-so charts (screenshot). Saved in a template. Attached the template.
  2. opened other charts (screenshot). Save it to a new template. The template was attached.
  3. Repeat steps 1, 2.
  4. Applied template №1 - what we got.
  5. and then apply template 2 - what we got.
Like this.
 
Oleg:

I don't know if this is the right topic.

Glitch with profiles in MT5 and MT4

When saving profiles, e.g. 6 charts for each pair separately, when I open a profile I often open a different one than the one I need. And the one I need won't open at all.

I thought the problem is in the broker's terminal in MT4 (originally I tried to configure the profiles there), I downloaded the original MT5 from Metaquotes and the same problem.


I understand roughly what the problem is. When I create a new field and save it with a different name, the profile is simply overwritten. Although it should be saved under a different name.


Where to dig?

This has always been the case. Any profile change causes changes to the open profile, then if you save it under a different name two identical profiles will be saved. To solve this problem you just need to follow the sequence of steps

1. Save the current profile.

2. Configure the new profile and save it under a different name.

Thus two different profiles will be saved...

 
Vladimir Karputov:


Start with a consistent and accurate description to start with. MT5 - build where the data directory is (after reloading take the top three lines from the log tab):

  1. so many charts open (screenshot). Saved it into a template. The template was attached.
  2. Opened other charts (screenshot). Save it to a new template. The template was attached.
  3. Repeat steps 1, 2.
  4. Applied template №1 - what we got.
  5. and then apply template 2 - what we got.
Approximately so.

Thank you for your quick response! Seems to have figured it out, the last saved template is not only saved under its name, but automatically becomes a default.

To save everything correctly, I open default, put the necessary charts and save them under my name.

Reason: