Errors, bugs, questions - page 1700

 
fxsaber:

This is the idea behind the non-removable indicator.

Is it about organizing a link to "itself"? So it's not "got", it's you who wrote the indicator in such an exotic way.

If you are confused by this behavior of the indicator, just do not do it.

Where to add it and how it could at least theoretically help. This is a bug in the terminal. It is a serious bug. I was lucky - I see in the log that the indicator works. However, there are a lot of indicators that work in the terminal without any information about them. But the topic comes up, and why is my CPU so loaded on an empty terminal?

There are quite a lot of ways to "shoot yourself in the foot". The indicator can be trivialized. And it's much easier to do it by accident than to accidentally write your design. Is this also a "terminal bug"?

 
Anton:

Is this about organising a reference to "yourself"? So it's not "got", it's you who wrote the indicator so exotically.

If you are confused by this behaviour of the indicator, just don't do it that way.

There are quite a lot of ways to "shoot yourself in the foot". The indicator can be trivialized. And it's much easier to do it by accident than to accidentally write your design. Is this also a "terminal bug"?

It is a terminal bug when it is possible to execute a heavy indicator unknowingly on a completely empty (without open charts) terminal. And then there are questions, why does your terminal load the CPU on a flat spot? It's a bug! There is no internal task manager, no control.
 
Anton:

Is this about organising a reference to "yourself"? So it's not "got it", it's you who wrote the indicator so exotically.

It's not exotic, it's an attempt to self-identify in the indicator. Trying to do it in a more civilized way turned out to be a bummer.
#property indicator_separate_window
#property indicator_buffers 0
#property indicator_plots   0

bool WhereIAm( long &Chart_ID, int &Sub_Window )
{
  const string PrevShortName = MQLInfoString(MQL_PROGRAM_NAME);  
  
  MathSrand((int)TimeCurrent());
  const string ShortName = (string)MathRand();
    
  IndicatorSetString(INDICATOR_SHORTNAME, ShortName);    
  
  Chart_ID = ChartFirst();

  Print(Chart_ID);
  
  while (Chart_ID > 0)
  {
    const int Total = (int)ChartGetInteger(Chart_ID, CHART_WINDOWS_TOTAL);
    
    for (Sub_Window = 0; Sub_Window < Total; Sub_Window++)
    {
      const int TotalIndicators = ChartIndicatorsTotal(Chart_ID, Sub_Window);
      
      for (int i = 0; i < TotalIndicators; i++)
        if (ShortName == ChartIndicatorName(Chart_ID, Sub_Window, i))
        {
          IndicatorSetString(INDICATOR_SHORTNAME, PrevShortName);
          
          return(true);
        }
    }
    
    Chart_ID = ChartNext(Chart_ID);
  }

  IndicatorSetString(INDICATOR_SHORTNAME, PrevShortName);
  
  return(false);
}


#define  TOSTRING(A) #A + " = " + (string)A + " "

void OnInit( void )
{
  long Chart_ID;
  int Sub_Window;
  
  if (WhereIAm(Chart_ID, Sub_Window))
    Print(TOSTRING(Chart_ID) + TOSTRING(Sub_Window));
    
  return;
}
int OnCalculate( const int rates_total,
                 const int prev_calculated,
                 const datetime &time[],
                 const double &open[],
                 const double &high[],
                 const double &low[],
                 const double &close[],
                 const long &tick_volume[],
                 const long &volume[],
                 const int &spread[] )
{
  return(rates_total);
}
So it's a bummer, because the Service Desk has been misled, to put it mildly.
 
fxsaber:
I haven't been writing in MQL5 for a long time, I'm not a programmer. I know MQL4 and now I know MQL5 a little. What is the reason for my almost daily encounter with bugs in MT5? In fact, almost every day a man in the street accidentally finds bugs! What is this all about, why it's so raw? No testers at all? I wouldn't be lying to say that MT is starting to get annoying. And even more annoying is the realization that I can't program in anything else.

Really? Hard to believe :)

Try

 
pako:

Really? Hard to believe :)

Try

I need only for trading. I won't get any high if I build a terminal, tester and other stuff. My life is not measured in hundreds of years.
 
fxsaber:
It's not exotic, it's an attempt to self-identify in an indicator. Tried to do it in a more civilised way it turned out to be a bummerThat's because at Servicedesk it was misleading, to put it mildly.

Please note point 2:

https://www.mql5.com/ru/docs/chart_operations/chartwindowfind

About the answer in the servicedesk - all people make mistakes sometimes.

Документация по MQL5: Операции с графиками / ChartWindowFind
Документация по MQL5: Операции с графиками / ChartWindowFind
  • www.mql5.com
Операции с графиками / ChartWindowFind - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
fxsaber:
I need only one for trading. I won't get a buzz out of building a terminal, a tester and so on. My life is not measured in hundreds of years.
We took the dates from MT, processed them into a dll.
 
pako:
Took dates from mt, processed in dll.
No problem with language, problems with visualisation (indicators) and date (copyticks). To write this on a DLL is a waste of time.
 
Anton:

Please note point 2:

https://www.mql5.com/ru/docs/chart_operations/chartwindowfind

About the answer in the service desk - all people make mistakes sometimes.

Thank you, the only thing left to do is to resolve the ShortName ambiguity.
 
fxsaber:
No problem with language, problems with visualisation (indicators) and date (copyticks). To write this on a DLL is a bummer.
Is there a fish in the ticks?