Wishes for MQL5 - page 39

 
ds2:
// Эти свойства задались уже при создании переменной.
// Менять их в программе, в принципе, особого смысла нет.
// Так что можно их (некоторые из них) сделать read-only
AvgType.DataType = int; 
AvgType.Value    = 0;
AvgType.Comment  = "Тип скользящей средней";

Would it make sense to do it this way?

class ExternParam
{
    <template typename T>
    property T Value ...;
    property String Comment ...;
}
 
SK. писал (а):
ds2:
SK. wrote (a):

I'd also like a break from if().

I haven't seen something like that in popular programming languages...

О. That's it, right on the money.

The positive statement in this statement is that if it's not in other languages, it's bad, it means that it's something foreign and unnecessary.

In my opinion that is not true at all.

I agree. But you have to look at the situation from higher levels of expediency as well. The priority of MQ, and ours too(!) is to improve MQL as a language of automated trading, and to develop its trading and analytical possibilities. And MQ still has many unsolved problems in this direction.


And the implementation of non-standard programming structures unrelated to trading - this is not what MQL was created for. If the developers wanted to somehow twist and stand out among other languages, they would have used Prolog, for example, not C++. :) (Although, personally, as a Prolog fan, it would have been interesting to watch it. :) )


I think no matter how much programmers here ask for a breakif, MQ is unlikely to waste time on it. And, in my opinion, they will do the right thing. And I suggest everyone not to bother MQ with requests that distract them from more pressing tasks of improving MQL as an automated trading language.

SK. wrote (a):

Complex constructs are not only formed based on loops and lists. They are also formed on the basis of ifs. So a controlled transition to an external closing bracket would be useful.

I'm all for goto. :)


The logic of such a program would be more transparent. After all, breakif is an early exit from an if-construction. Like any early exit, it should be performed by some condition, i.e. inside one more if. Thus, we are talking about breakif as an exit operator not for one but for two(!) if' s, which complicates understanding of the logic of a program and also breaks from the general concept of breaks(breakfor, breakwhile, etc.) as operators that exit only for one construct. Maybe that's why developers of other languages still haven't introduced such a dubious operator...

 
ds2 писал (а):
And I suggest everyone not to bother MQ with requests that distract it from more pressing tasks of improving MQL as an automated trading language.


I'm all for it. :) The logic of such a program will be more transparent.

Dear developers! Please do not be distracted "from the more pressing tasks of improving MQL as an automated trading language".

We will not bother you anymore.

The only thing you still need to do is to take ds2's opinion into account.

 

Inspired by Skeptic Filozov's article - ah, enter the average profit and loss in pips and max and min trades too in the test report.

 

Requests read only


Enter functions or allow current functions to access all sub-folders of the terminal

where there is material to process: e.g. logs

read only" mode.


Plan another folder \experts\services

Where all sorts of information from DM would be written in a centralized manner.

For example an auto-updated formatted calendar file, news "in numbers" etc...


If you need to clarify what the request is about, no problem. ;)

 

In the graph it would be nice to have
1. hairline, as lines of thickness 1 look coarse.

2. it would be nice to have lines displayed with Digits+2 rounding.

Right now the lines are rounded to the Digits of the tool, which leads to a stepping stone.

-In the environment of modern graphic products this is striking and is no longer convenient in practice.

 
Due to the fact that the advisor can serve the client's schedule, "technological ticks" are very much needed
e.g. in the form of
int servis() 
{
return(0);
}

Which also receives/starts like Start, but not from a server, but from a local timer of the terminal.
The required period of technological ticks will not harm anyone: from 1 to 3 seconds.
This change can be introduced directly in MQL-4 without waiting for the 5th version. So to say, for the sake of testing and for the sake of business.
 
Korey:

ERROR in METALANG

extern double  Lot=0.2;
int start()
{ double   Lot; }

Double variable initiation goes through compilation without error or warning.


extern double  Lot=0.2;
double   Lot;   //а так ошибку - дает
int start()
{ }

A local variable masks a global variable. There is no error.

 

Korey, zero precisely because the external variable is masked:

double Lot;

- it is an uninitialized declaration of a local variable inside the start() function. By default it is initialized to zero. All functions that are called in start() and have the input parameter Lot receive the value of a local variable, not an external one. The only exception is for functions within init() that are executed before start(). There, the Lot parameter (if it's not masked similarly) must get the value of an external variable, i.e. 0.2.


You cited the wrong or incomplete code. Where do you call my_funck() from?

 
Korey:

If it was masking, then why do the other functions get 0 and not 0.2. as prescribed in the extern?


You need to check the statements yourself. Here is a simple script:

//+------------------------------------------------------------------+
//|                                                CheckVariable.mq4 |
//|                      Copyright © 2008, MetaQuotes Software Corp. |
//|                                       http://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.net/"
 
extern double Var = 0.0;
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int init()
   {
   Print("Функция init():Внешняя переменная на глобальном уровне Var=",Var);
   }
 
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
void MyFunc()
   {
   Var = -100;
   Print("Функция MyFunc(): Переменная Var=",Var);
   }
 
//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
int deinit()
   {
   Print("Функция deinit():Внешняя переменная на глобальном уровне Var=",Var);
   }
 
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
//----
   double Var = 15;
   Print("Локальная переменная на локальном уровне функции start() Var=",Var);
   MyFunc();
   Print("Локальная переменная на локальном уровне после выполнения функции MyFunc() Var=",Var);
 
   Print("Функция start() завершена");
 
//----
   return(0);
  }
//+------------------------------------------------------------------+


and the results of the script.