Errors, bugs, questions - page 1848

 
Artyom Trishkin:
What happened to IndicatorDelete() in MQL5? The compiler doesn't recognize it.
It has never been. You are confused with IndicatorRelease
 
Slawa:
It never was. You are confused with IndicatorRelease
Or with ChartIndicatorDelete
Документация по MQL5: Операции с графиками / ChartIndicatorDelete
Документация по MQL5: Операции с графиками / ChartIndicatorDelete
  • www.mql5.com
Операции с графиками / ChartIndicatorDelete - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Slawa:
It never was. You are confused with IndicatorRelease.
I'm just saying it's the work of the evil one.
 
Create unnecessary template overloads which cause compilation errors
template <typename T>
T Func()
{
  T Res;
  
  return(Res);
}

template <typename T>
void Func( T& Value )
{
  T Res = (MqlTick)Value;
}

void OnStart()
{
  Func<string>(); // без этой строки компилируется
  
  MqlTick Tick;
  
  Func(Tick);
}

The compiler tries for some reason to create

void Func( string& );
 
void OnStart()
{
  int i = {0}; // code generation error
}

It is clear that the code is incorrect, but why this particular error?

 
Hi all, I'm a newbie! Can you please advise whether it is possible in mql4/5 to display a large text (100-200 words) in the object description on a chart (trend line/level)? I want to keep a diary.
 
Dear developers, how do you get rid of Warnings in this situation?
template <typename T>
T GetValue()
{
  T Res; // possible use of uninitialized variable 'Res'
  
  return(Res);
}

void OnStart()
{
  MqlTick Tick = GetValue<MqlTick>();
  int i = GetValue<int>();
}
 
Renat Fatkhullin:

We will check everything in detail on Monday.

I can't answer right now without tests.

Reproduced, such on stock ticks.

Fixing
 

How can I get the number of the current pass in the same form as it is displayed in the optimizer results tab, for example, "27, 366" or "18, 442" written in the first column in MQL5, for example? The FrameNext function allows you to get the pass number as ulong. How to get from this number what is displayed to the user? I need to display information by passageways in a special report, and keep the same designation of passageways as in the terminal.

 
Dear developers, is it possible to find a normal solution for MQL not to multiply such entities?

Forum on trading, automated trading systems and strategy testing

Do I need global terminal variables of type string?

fxsaber, 2017.04.10 18:25

#define  GLOBAL_VARIABLE_SET(A)                                                        \
template <typename T>                                                                 \
  datetime _GlobalVariableSet( const string Name, const T A )                         \
  {                                                                                   \
    _GlobalVariableDel(Name);                                                         \
                                                                                      \
    double Array[];                                                                   \
                                                                                      \
    const datetime Res = GlobalVariableSet(Name, _ArrayCopy(Array, _R(Value).Bytes)); \
    const int Size = ArraySize(Array);                                                \
                                                                                      \
    for (int i = 0; i < Size; i++)                                                    \
      GlobalVariableSet(GetName(Name, i), Array[i]);                                  \
                                                                                      \
    return(Res);                                                                      \
  }

GLOBAL_VARIABLE_SET(Value)
GLOBAL_VARIABLE_SET(&Value)
GLOBAL_VARIABLE_SET(&Value[])
Reason: