Errors, bugs, questions - page 413

 

Then please tell me what will be returned if the function succeeds

and what it will return if it fails, because the documentation doesn't say anything about it...

as I understand 1 is true

0 - false ???????????????

//-----------------------------------------//

Returns the value of a corresponding property of a running mql5 program.

intMQL5InfoInteger(
intproperty_id// property identifier
);

Parameters

property_id

[Identifier of the property. Can be one of values of enumeration ENUM_MQL5_INFO_INTEGER.

Returned value

Value of int type.

//---------------------------------------//

 

In this construction

NormalizeDouble(p, SymbolInfoInteger(symbol,SYMBOL_DIGITS));

error of data type mismatch

possible loss of data due to type conversion


Maybe someone knows how to fix it = really ...?

Thank you!

 
Im_hungry:

Then please tell me what will be returned if the function succeeds

and what it will return when it fails

The docs don't say anything about"failed" execution MQL5InfoInteger.

To control success use GetLastError

 
Im_hungry:

Does anyone know how to fix it = really ...?

to bring it to the required type.
 
sergeev:
to the required type.

I don't know how you're going to bring it in when the developer documentation clearly shows

That long to int will not work as you write: "cast to the required type".

 
sergeev:

there is nothing in the docs about"failed" execution MQL5InfoInteger.

And to control success use GetLastError

I understand your skeptical optimism,

Thank you for your help, have a nice day.

 
Im_hungry:

I don't know how you can cite it if the developers' documentation clearly shows

That long to int will not work as you write: "reduce to the required type".

Like this

int OrdersLimit = (int)AccountInfoInteger(ACCOUNT_LIMIT_ORDERS);
 
Interesting:

It goes something like this.

At last=the first even-breathing real person appeared for

today, thank you ALL works. Good luck!

 

I can't beat iCustom().

Both in Quartet and now in Fiver, when extracting indicator values in the bars with no signals

iCustom() sometimes displays different artifacts:

The data is extracted as follows:

int OnInit()
  {
...
    IH=iCustom(Symbol(),PERIOD_CURRENT,"Indicator.ex5");
...
  }

void OnTick()
  {
...
      double IC=0;      
      double IB[];
      CopyBuffer(IH,1,WorkBar,1,IB);
      IC=IB[0];
      if(IC>0){Print(IC);}
...
  }

The value of the variable WorkBar=1 determines the number of the bar, the value of which we are extracting from the buffer.

What could be the problem? You can't use variables?

If you try to extract data from two different buffers in one tick, sometimes you get the following:

 
MoneyJinn:

I can't beat iCustom().

Both in Quartet and now in Fiver, when extracting indicator values in the bars with no signals

sometimes iCustom() produces different artifacts:

Always explicitly set values for all bars in the indicators. Read the article Indicator by Indicator in MQL5:

You should set a value for each element of the indicator buffer, and if the indicator value for a given bar is not defined (not calculated, according to the algorithm embedded in the indicator), you should explicitly set an empty value for such cases. For example, the indicator buffer value is calculated through the division operation, and at some point it may turn out that the divider is equal to zero.

Reason: