Errors, bugs, questions - page 1990

 
Alexey Viktorov:

Well, the number of graphic series is defined at the beginning of the code, which does not change when the TF is switched.

I am afraid that it is invincible in mql5.

Although, there is one more trick, to exclude displaying of graphic series in data window

It works in mql4. I need to check how it works in mql5, I haven't tested it yet.

Thanks for the help, apparently, if developers do not correct this point, I will just initialize buffers with initial values and that's all.

But I wanted something else - economy in calculations.

 

In ME it would be nice to have templates for display themes, otherwise it would take a long time to adjust by colour matching

 

An example from the SB explaining why the SB should be tweaked at least a little, so that it doesn't slow down in the tester.


Original

//+------------------------------------------------------------------+
//| Select a position on the index                                   |
//+------------------------------------------------------------------+
bool CPositionInfo::SelectByIndex(const int index)
  {
   ENUM_ACCOUNT_MARGIN_MODE margin_mode=(ENUM_ACCOUNT_MARGIN_MODE)AccountInfoInteger(ACCOUNT_MARGIN_MODE);
//---
   if(margin_mode==ACCOUNT_MARGIN_MODE_RETAIL_HEDGING)
     {
      ulong ticket=PositionGetTicket(index);
      if(ticket==0)
         return(false);
     }
   else
     {
      string name=PositionGetSymbol(index);
      if(name=="")
         return(false);
     }
//---
   return(true);
  }


How to

//+------------------------------------------------------------------+
//| Select a position on the index                                   |
//+------------------------------------------------------------------+
bool CPositionInfo::SelectByIndex(const int index)
  {
   return(PositionGetTicket(index));
  }
 

Hello! 2017.09.05_20:00 GMT+3. I replaced the main file in the generated EA from procedural to OOP. But it is not working. Bare price appears in the tester, no indicator. Maybe I haven't initialized everything? I haven't figured it out myself. Maybe someone will take a look? Why have I started to write the main OOP file? The procedure file has a compile time of more than 3 seconds. I don't know if there is a limit on compile time? I'll try to post all the necessary files. 20:07 GMT+3.

Files:
 
ME severely lacks correct hints after custom object operators
struct STRUCT
{
  int i;  
};

class BASE
{
public:
  void Func() {};
  
  STRUCT operator []( int )
  {
    STRUCT Res = {0};
    
    return(Res);
  }
};

class CLASS : public BASE {};

void OnStart()
{
  BASE Object1;
  
  Object1[0].i = 1;
    
  CLASS Object2;
  
  Object2[0].i = 1;
}


When you type the yellow line, after the dot a hint appears in the form of fields/methods of the structure - i.

When typing red string after the dot a completely wrong hint - Func, while it should be i.

 

Good afternoon, please consider adding a filter to freelance for reviews based on the number of stars.

If the performer has hundreds of jobs, it's hard to know how they behave in exceptional situations - https://<Personage ads deleted by Artyom Trishkin
For example, when you click on three stars the page reloads and only those reviews that have three stars or less remain.
Thanks for that.

 
Is it a bug?
struct STRUCT
{
private:
  int i;
};

void OnStart()
{
  STRUCT Struct = {0}; // 'Struct' - cannot be initialized with initializer list
}
 
Sergey Dzyublik:

Good afternoon, please consider adding a filter to freelance for reviews based on the number of stars.

If the performer has hundreds of jobs, it's hard to know how they behave in exceptional situations - https://<Personage ads deleted by Artyom Trishkin
For example, when you click on three stars the page reloads and only those reviews that have three stars or less remain.
Thanks for that.

Sergey, please contact Service Desk with this question - or rather with clarifications (links to performers' profiles).

 
Because of this "bug ", I can't figure out how to humanly avoid Warning in this situation?
struct STRUCT
{
private:
  int i;
};

// Нужен только для того, чтобы показать необходимость решения без конструктора
union UNION
{
  STRUCT Struct; // конструктора не должно быть
  int i;
};

// Обходим Warning "possible use of uninitialized variable"
template <typename T>
void StructInit( T& ) {}

STRUCT Func()
{
  STRUCT Res; // possible use of uninitialized variable 'Res'
  
//  StructInit(Res); // с этой строкой Warning не появляется, но это какой-то абсурд!
  
  return(Res);  
}

void OnStart()
{
  Func();
}


Please help.

 
fxsaber:
Because of this "bug ", I can't figure out how to humanly avoid Warning in this situation?


Please help.

Add a default constructor to the structure.
Reason: