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

 
(bleep))) Zero out))
 

We need to get the men from the forecasts and the investigations out of here. Why are they piled up there like a manger... They should make a branch for every picture. Why...

Oh, I forgot... ...the villagers need to be resettled. Let one write in his own thread and the other reply in his own. It's perfect...

 
Zhunko:
And don't forget that topic flooding is also flooding.
Dimitri, as a super-specialist in all fields of knowledge, you should know that normal people tend to organise themselves. Normal people don't need bosses, moderators and you. Normal people have their own moderator in their head.


Well, they do, I can see it showing itself (the inner moderator).

 
Zhunko:
And don't forget that topic flooding is also flooding.
Dimitri, as a super-specialist in all fields of knowledge, you should know that normal people tend to organise themselves. Normal people don't need bosses, moderators and you. Normal people have their own moderator in their head.


You're going too far with that ratty thing, just don't let it come off on its own, accidentally, in the nick of time. Junko, you'd probably kill me if you had the chance, wouldn't you?

And also, to your great sorrow, life shows the opposite - that I am really needed by someone, and that I am really an expert in something, even though you have another sarcasm.

 

In order to save the nerves of the local old-timers, I'll ask here. There are 4 tickets in the array. At every tick it is checked if any order is closed, then it should be overwritten with 0. Here is the code:

 for (int i=0; i<4; i++)
   {
      if (mas[i]==0) continue;
      OrderSelect(mas[i], SELECT_BY_TICKET, MODE_HISTORY);
      if (OrderCloseTime()>0)
      {
         mas[i]=0;
         if (OrderProfit()<0)
         {
            if (OrderType() == OP_SELL)
            {
               OrderSend(Symbol(),OP_BUY,lots,Ask,20,Bid-stop*Point,Bid+take*Point);
            }
            else
            {
               OrderSend(Symbol(),OP_SELL,lots,Bid,20,Ask+stop*Point,Ask-take*Point);
            }
         }
      }
   }
The point is that all values are zeroed.
 
ilgar-90:

In order to save the nerves of the local old-timers, I'll ask here. There are 4 tickets in the array. At every tick it is checked if any order is closed, then it should be overwritten with 0. Here is the code:

The point is that all values are zeroed.


Ticket orders may change, since you don't check for OrderSelect (what does it return?) , it is possible that you may roll the same tick several times.
 
ilgar-90:

In order to save the nerves of the local old-timers, I'll ask here. There are 4 tickets in the array. At every tick it is checked if any order is closed, then it should be overwritten with 0. Here is the code:

The point is that all values are reset to zero.

I would like to ask you: 1. What is contained in mas[i] before this loop and what is contained in mas[i] after this loop?

2. Do a priming of the array values mas[] before this loop and after this loop too in the loop, printing the array values. You may change the loop itself a bit:

for (int i=0; i<4; i++) {
   if (mas[i]==0) continue;
   if (OrderSelect(mas[i],SELECT_BY_TICKET)) {  
      if (OrderCloseTime()>0) {
         mas[i]=0;
         if (OrderProfit()<0) {
            if (OrderType()==OP_SELL)  OrderSend(Symbol(),OP_BUY,lots,Ask,20,Bid-stop*Point,Bid+take*Point);
            else                       OrderSend(Symbol(),OP_SELL,lots,Bid,20,Ask+stop*Point,Ask-take*Point);
            }
         }
      }
   }

Why only Sell and, if not it, everything else possible?

 
ALXIMIKS:

Order tickets may change, because you don't check for OrderSelect (what does it return?) , it is possible that you spin the same ticket several times.

I'll correct slightly, the tickets don't change, the positions do.
 
Sepulca:

Slight correction, tickets do not change, positions do.


I am not competent in this matter, but when an order is half-closed the ticket number of the remaining part of the order changes,

I also read somewhere that the ticket number may change when transferring over the weekend (does it depend on the DC or what?)

 
Integer:


And about that, marked with a rat, you're swinging too far, see how it doesn't fly off by itself, accidentally, in between. Junko, you'd probably kill me with gusto if you had the chance, wouldn't you?

And also, to your great sorrow, life shows the opposite - that I am really needed by someone, and that I am really an expert in something, even though you have another sarcasm.

Ugh! :-((

Dimitri, what kind of fantasy are you, fantasy, ours? You're part of me. Why would I kill myself? I'm fine as I am.

Reason: