Errors, bugs, questions - page 2994

 
Alexandr Bryzgalov:

the reference does not correctly state the order of the parameters.


What is your evidence?

 
Vladimir Karputov:

What is your proof?

/

 
Vladimir Karputov:

What is your evidence?

No. There is no mistake.

I was confused by the order itself. And the fact that it doesn't take 0. It always wants a variable.


 
Alexandr Bryzgalov:

No. There is no mistake.

The order itself is confusing. And that it doesn't take 0. It necessarily needs a variable.

That's what it says in the help - it needs a VARIABLE

   int&           sub_window,   // The number of the subwindow 
 
Vladimir Karputov:

That's what it says in the fact sheet - VARIABLE is needed

 

Friends, help me out here. I'm completely baffled by what's going on.

#property indicator_chart_window
#property indicator_plots 0

int                      ma_handle;
bool FirstStart;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   if(ChartPeriod()!=PERIOD_M1)
     {
      ChartSetSymbolPeriod(0,_Symbol,PERIOD_M1);
     }
   ma_handle=iCustom(Symbol(),PERIOD_H1,"Indicator For Search Data");
   FirstStart = true;
   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//|                                                                  |
//+------------------------------------------------------------------+
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[])
  {
   ulong tmpTimeCopy = GetMicrosecondCount();
   if(FirstStart)
     {
      double tmp[];
      datetime DateStart=D'2018.07.19', DateEnd=D'2021.01.19 23:59:59';
      int DataCopy=-1;
      while(true)
        {
         DataCopy=CopyBuffer(ma_handle,0,DateStart,DateEnd,tmp);
         if(DataCopy<0)
            Print("Return");
         else
           {
            IndicatorRelease(ma_handle);
            FirstStart=false;
           }
         if(!FirstStart)
            break;
        }
      Print("Time Copy Buffer: ", GetMicrosecondCount() - tmpTimeCopy);
      Print("Data to Copy: ", DataCopy, " ", tmp[0], " ", tmp[1], " ", tmp[2], " ", tmp[3], " ", tmp[4]);
      Print(datetime(tmp[0])," ",datetime(tmp[1])," ",datetime(tmp[ArraySize(tmp)-1]));

     }
   return(rates_total);
  }

Here's the whole indicator. When it starts up, it starts giving

Screenshot

Why such optimism. If I press pause or stop, I still get values in Expert Advisor tab of Toolbox window. The window with the indicator is already closed, but the values are successfully displayed.

How does this happen? Who can explain something?

 
ROMAN KIVERIN:

Friends, help me out here. I'm completely baffled by what's going on.

Here's the whole indicator. When it starts up, it starts giving

Why such optimism. If I press pause or stop, I still get values in Expert Advisor tab of Toolbox window. The window with the indicator is already closed, but the values are successfully displayed.

How does this happen? Can someone explain something?

Who said that CopyBuffer() will be successful at least once?

Who said that iCustom() will be successful?

"Errors can form cycles. The most persistent of these is infinite." Error theory.
 

Since the last update, theEnumToString functiondoes not work correctly depending on the code being called. A separate call toEnum_ does not reproduce the error.

template<typename T>

int Enum_(T enum_value)
  {
   ...
         s1=EnumToString(T(i1));

   ...

   }

In debugger:

GetLastError returns:

ERR_INVALID_PARAMETER.

4003

Erroneous parameter when calling a system function

 

help copy from mt4 magazine

sell 0.20 CL-MAY21 at 59.36 sl: 0.00 tp: 0.00 -> sl: 0.00 tp: 58.00
14:07:13.521 Trade: '50223437': order #5595882 sell 0.20 CL-MAY21 at 59.36 was modified -> sl: 0.00 tp: 58.00
15:56:34.215 Startup: MetaTrader 4 for Android
15:56:34.223 Startup: Copyright 2001-2021, MetaQuotes Software Corp.
15:56:34.223 Startup:
15:56:34.223 Startup: Device: samsung a41 (QP1A.190711.020.A415FXXU1BUC3) 10(REL) 29SDK
15:56:34.223 Startup: Kernel: 4.14.141-20194519
15:56:34.239 Terminal: Native library initialized. Version 400 Build 1334
15:56:34.259 Chat: initialization success
15:57:43.276 Terminal: Codepage for current language (ru_RU) is 'CP1251'
15:57:43.277 Terminal: Using 'windows-1251' for server strings
15:57:43.284 Terminal: Terminal instance created
15:57:43.641 Terminal: Connecting to PinedaIntl-Trader through 'Main'
15:57:43.793 Terminal: Connected to PinedaIntl-Trader through Main
15:57:43.993 Chat: connected to msg.mql5.com:443
15:57:44.088 Network: '50223437': login successfull [connection type: unknown]
15:58:02.749 GL: Texture size: 256x256
15:59:35.745 Trade: '50223437': modify order #5595882 sell 0.20 CL-MAY21 at 54.19 sl: 0.00 tp: 58.00 -> sl: 0.00 tp: 52.0015:59:36.073 Trade: '50223437': order #5595882

how did this happen

 
JRandomTrader:

Who says CopyBuffer() will ever succeed?

Who says that iCustom() will be successful?

"Errors can form cycles. The most persistent of these is infinite." Error theory.

The interesting thing is that this function is executed successfully. It is executed and produces values. After that, the terminal only enters an incomprehensible state.

The iCustom() function is executed successfully as well.