[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 394

 
paladin80:
Print the values pr, stop and take to see what they send to OrderModify

Printed it out, thanks, in different variations, indeed the values sometimes coincide. It's a coincidence as I understand it. The values of modify coincided with the values I set them to originally. But in general, the terminal compares values and if they coincide, it does not modify orders and outputs error 1.
 
Roger:

Before comparing fractional numbers, they need to be normalised.

Thank you, I will definitely normalise them later, after a coarse test, so as not to make the work heavier. Or is it better to normalize them right away? The modification parameters there just happened to coincide with the values I was setting them to. That's why the terminal didn't skip such modification.
 
Hi) can you tell me if it is possible to use mql4 to send e.g. the current price to your personal website?
 
veti-k:
Hi) can you tell me if it is possible to use mql4 to send e.g. the current price to your personal website?

Yes, supposedly. https://docs.mql4.com/ru/common/SendFTP

https://www.mql5.com/ru/forum/108621

 
rosomah:

Thank you, I will definitely normalise later, after a rough test, so as not to weigh down the job. Or is it better to normalise them right away? The modification parameters there just happened to coincide with the values I set them to. That's why the terminal didn't skip such modification.

And what, your religion doesn't allow you to fix all errors first and only after that start testing?
 
Is there a function that returns the time value of the last time a quote was given? If not, what standard functions can be used to write a custom function for an appropriate purpose?
 
iMAG:

Doesn't your religion allow you to fix all the bugs first and only then start testing?


"Doesn't religion allow you to guess first" that some errors are shown in the "Logbook" of the terminal, during testing? No programmer can brag that his "log" did not pop up errors, so do not talk nonsense.

 
vradii:
Is there a function that returns the time value of the last time a given quote was given? If not, what standard functions can be used to write a custom function for an appropriate purpose?

https://docs.mql4.com/ru/objects/ObjectGetShiftByValue

or like this:

// Поиск ближайшей точки пробоя линии
void fBreakPoint(string Name                 // Имя пробоя
                ,int Bar1,double Price1      // Начать поиск
                ,double Speed                // Наклон линии
                ,int Bar2                    // Закончить поиск
                ,int& Bar,double& Price) {   // Пробой линии
   Bar=LastBar-1;
   Price=0;
   datetime Time1=Time[Bar1],
            Time2=Time[Bar2];
   if( Bar1<LastBar || Bar2<LastBar || Price1<Zero ) {
      if( РежимОтладки ) Print("***   "+Name+" - параметры пробоя: "
                    +DoubleToStr(Price1,Digits)+" ("+Bar1+"/"+TimeToStr(Time1)
                                            +")...("+Bar2+"/"+TimeToStr(Time2)+")");
      return;
   }
   int Step;
   double H, L, P;
   if( Bar2>Bar1 ) Step=1; else Step=-1;
   if( High[Bar1]-Price1>Zero
    && Price1-Low[Bar1]>Zero ) {             // Первый бар
      Bar=Bar1;
      Price=Price1;
      return;
   }
   while( Bar1!=Bar2 ) {
      H=High[Bar1];                          // Предыдущий бар
      L=Low[Bar1];
      P=Price1;
      Price1-=Step*Speed;                    // Текущий бар
      Bar1+=Step;
      if( ( High[Bar1]-Price1>Zero && P-L>Zero )
       || ( Price1-Low[Bar1]> Zero && H-P>Zero ) ) {
         Bar=Bar1;
         Price=Price1;
         return;
   }  }
   return;
}
 
rosomah:

I've got it, thanks, in different variations, the values do match up. It's my understanding that it's an accident. The values of the modification coincided with the values I had originally set them to. But in general, the terminal compares values and if they are the same, the order is not modified and error 1 is output.
There should not be any randomness in the programme operation. I have to find out why this happened and correct it.