Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1021

 
Vladimir Karputov:

I wasn't threatening anyone. You are dreaming.

Also you have mixed up MQL5 and MQL4. MQL5 code are files with extension .mq5.

I didn't threaten anyone, but made an observation, it's a humorous turn of phrase :-)

I was quoting code five here, perhaps you have mistaken me for someone else.

 
psyman:

I don't mean to threaten, but to reprimand, it's a humorous turn of phrase :-)

I was quoting code five here, perhaps you have me confused with someone else.

Two steps:

compare the number 4 and 5. Find the difference.

Go through your posts and look at the number.


And in general this thread is about MQL5, stop ranting about being here.

 

Friends, can you help with a function that would select the characters of open positions and save them in an array. I don't seem to have a problem with it, but I can't get rid of the duplicates if there are several open positions.

 
Alexander Mikryukov:

Friends, can you help with a function that would select the characters of open positions and save them in an array. I don't seem to have a problem with it, but I can't get rid of duplicates when there are multiple open positions.

Here, rewrite it for mql5

  for(int i=0; i<OrdersTotal(); i++) {
   if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
    if(OrderType()<2) {
     if(ArraySearchStr(symbols, OrderSymbol())==-1) {
      b++;
       ArrayResize(symbols,b+1);
       symbols[b]=OrderSymbol();
  }}}}

//===============================================================================================
//------------------------------ Функция удаляет копии с массива -------------------------------+
//===============================================================================================
int ArraySearchStr(string& m[], string e) {
  for(int i=0; i<ArraySize(m); i++) {
   if(m[i]==e) return(i);
  }
  return(-1);
 }
 
Vitaly Muzichenko:

Here, for mql5, rewrite it yourself

Thank you.

 

Help me understand something I don't understand.

      for(int p = 0; p < InpShiftCorrection; p++) prs += pressureDetermination(open[i],close[i],high[i],low[i]);
      prs /= InpShiftCorrection;
      prs *= (high[i] - low[i]);
      Print(NormalizeDouble(prs,Digits()));

The question is, why does the normalisation printer produce such nonsense?

2019.03.29 22:53:29.310 2019.01.02 06:01:21   -0.00025
2019.03.29 22:53:29.310 2019.01.02 06:01:21   0.00012
2019.03.29 22:53:29.310 2019.01.02 06:01:21   8.000000000000001 e-05
2019.03.29 22:53:29.310 2019.01.02 06:01:21   -9.000000000000001 e-05
2019.03.29 22:53:29.310 2019.01.02 06:01:21   -9.000000000000001 e-05
2019.03.29 22:53:29.310 2019.01.02 06:01:21   5 e-05
2019.03.29 22:53:29.310 2019.01.02 06:01:21   -4 e-05
2019.03.29 22:53:29.310 2019.01.02 06:01:21   0.00017
2019.03.29 22:53:29.310 2019.01.02 06:01:21   -8.000000000000001 e-05
2019.03.29 22:53:29.310 2019.01.02 06:01:21   -0.00052
2019.03.29 22:53:29.310 2019.01.02 06:01:21   -0.00029
2019.03.29 22:53:29.310 2019.01.02 06:01:21   -0.00114
2019.03.29 22:53:29.310 2019.01.02 06:01:21   0.00123
 
Сергей Таболин:

Help me understand something I don't understand.

The question is, why does the normalisation printer produce such nonsense?

Print(NormalizeDouble(prs,Digits()));
Print(DoubleToString(prs,Digits()));
 
Vitaly Muzichenko:

I'll give it a try. Thank you. But up until now, this same printer has produced exceptionally correct values...

 
Сергей Таболин:

I'll give it a try. Thank you. But up until now, this same print has been giving out exclusively correct values...

He flattered you)

 
Vitaly Muzichenko:

He was flattering you))

Apparently so )))) It worked.