[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 227

 
deyron:

Thanks, great! I was already stuck))))

Tell me, if it's not difficult, what's the catch? I searched the site and could not find an explanation(( or if you can throw me a link.

The "catch" is the reluctance to use the help, tutorial and documentation (see top of the site) + this thread - see all the links in it in full) on your part... :-)

+ google search - RULE.

Try and press F1 more often on the highlighted functions in the ME editor - there should be less questions like that when parsing the text! :-)



 

Hello, could you please tell me which function can close the penultimate open order of a type among many open orders and which function can close the very first order of a type? I searched on the web, read the tutorial, but could not understand.

I am grateful in advance.

 
Roman.:

The "catch" is the reluctance to read the help, tutorial and documentation (see the top of the site) + this thread - see all the links in it in full) on your part... :-)




Thank you, sorry to waste your time on such a comprehensive answer.

I asked, if possible with emphasis that: why through Comment the difference is shown rounded to 0.00002 although the result is 0.000178. Rounding is understandable to me, depending on the type of variables. BUT TYPE DOUBLE and by logic(mine) should not be rounded to 0.00002. (Why it is rounded that way is not clear to me)

Thanks again. I HAVE F1 ON MY KEYBOARD.

int start()
  {
double a=1.123456789,
       b=1.000000001,
       c=a+b;
       Comment("c = ",c);                Итог:2.1235
   return(0);
  }

Although in the tutorial:

Values of real constants and variables consist of an integer part, a decimal point (.) and a fractional part. They can take positive and negative values. The integer part and the fractional part are made up of digits 0 to 9. The number of significant digits after the decimal point can be up to 15. For example:

27.12 -1.0 2.5001 -765456.0 198732.07 0.123456789012345

 
deyron:

Thank you, sorry to waste your time on such an exhaustive answer.

I asked to focus my attention, if possible, on the following: why Comment shows the difference rounded to 0.00002 though the result is 0.000178. Rounding is understandable to me, depending on the type of variables. BUT TYPE DOUBLE and by logic(mine) should not be rounded to 0.00002. (Why it is rounded that way is not clear to me)

Thanks again. I HAVE F1 ON MY KEYBOARD.

Although in the textbook:

Values of real constants and variables consist of an integer part, a decimal point (.) and a fractional part. They can take positive and negative values. The integer part and the fractional part are made up of digits 0 to 9. The number of significant digits after the decimal point can be up to 15. For example:

27.12 -1.0 2.5001 -765456.0 198732.07 0.123456789012345


And why so lazy to read the reference

void Print(...)
Prints some message to the expert log. Parameters can be of any type. The number of parameters may not exceed 64.

Arrays cannot be passed to Print(). Arrays must be printed element by element.

Data of the double type is printed with 4 decimal digits after the point. To get more accuracy one should use theDoubleToStr()function .
Data of the bool, datetime and colour types will be printed as numbers.
To print datetime values as a date string, use theTimeToStr() function.

See alsoAlert() and Comment().

 

Hello, could you please tell me which function can close the penultimate open order of a type among many open orders and which function can close the very first order of a type? I searched on the web, read the tutorial, but could not understand.

I am grateful in advance.
 
Now I get it. Thank you. Just read the reference, that's all. It's called: "

Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 4."

I understand that for you it's like 2 +2, but for me it is not (I hope so far), and YOU these questions seem childish.

I do not know how everyone else's book I have OPEN, then when studying transferred to the CONSPECTS (4-general notebook 1-polu.obsch. 1 A4 format and 1-general draft).

Well missed(ish), or I'm half a day flip through or throw you a link, no need to break it all - read for yourself.

Thanks again.

 
deyron:
Now I get it. Thank you. Just read the reference, that's all. It's called: "

Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 4."

I understand that for you it's like 2 +2, but for me it is not (I hope so far), and YOU these questions seem childish.

I do not know how everyone else's book I have OPEN, then when studying transferred to the CONSPECTS (4-general notebook 1-polu.obsch. 1 A4 format and 1-general draft).

Well missed(ish), or I'm half a day flip through or throw you a link, no need to break it all - read for yourself.

Thanks again.


And you don't have to leaf through anything. There's a magic button
 
anton777:

Hello, could you please tell me which function can close the penultimate open order of a type among many open orders and which function can close the very first order of a type? I searched on the web and read the tutorial but failed to understand.

Thanks in advance.

Try writing OrderClose() in place of Comment. Notice the direction is set and you don't have to scroll anything))))

for(int i=0; i<=OrdersTotal(); i++)
         {
         if(OrderSelect(i-1, SELECT_BY_POS)==true)
            {
            if(i==2)
               {
               int Ord_ticket=OrderTicket();
               Comment("Ord_ticket = ",Ord_ticket);
               }
            }
         }
 
deyron:

Try writing OrderClose() behind Comment. Notice the direction is set and you don't need to scroll))))

The order closes all orders for some reason, maybe I wrote OrderClose() wrong.
 
anton777:
It closes all orders for some reason, maybe I'm writing OrderClose() wrong.

Do the loop the other way around. From more to less