Questions from a "dummy" - page 247

 
zfs:

Faced with a new system for turning an order into a position in a robot development environment.

Question: Will the position resulting from order #1 get the Magic of order #1?

Will the position which is triggered by order #2 get the Magic of order #1 or order #2?

you can find it out yourself. open the position with the script and look at the magic number and the identifier. what is the problem with this action?

If a stop position = Stop order No.3, what will the new position get for Magic 1(2) or 3, i.e. what will the trading server process first for the stop or the opposite order?

both.
 
sergeev:

you can find that out for yourself. open the pose with the script and look at the magik and identifier. what is the problem with this action?

both.
I tried to recreate the situation, but I had to wait for it until the orders were executed, and I hoped to get an answer on the forum faster, but I guess that's not the case)
 
zfs:
but you have to wait for it until the orders are executed
??? your brokerage company has a half year time lag? leave your brokerage company urgently. there will be no profit :)))
 
sergeev:
??? your brokerage company is filling orders with a six month delay? leave this brokerage company. urgently. there will be no profit :)))
as i can place an order with a minimum stop loss, i have to wait for its execution to find out the answer, so DTs have nothing to do with profit, while you should be kinder to dummies)
 
zfs:
I can place orders at a minimum distance of a stop loss
orders
 
In the Bars documentation there is an example of
   int bars=Bars(_Symbol,_Period);
   if(bars>0)
     {
      Print("Количество баров в истории терминала по символу-периоду на данный момент = ",bars);
     }
   else  //нет доступных баров
     {
      //--- видимо, данные по символу не синхронизированы с данными на сервере
      bool synchronized=false;
      //--- счетчик цикла
      int attempts=0;
      // сделаем 5 попыток дождаться синхронизации
      while(attempts<5)
        {
         if(SeriesInfoInteger(Symbol(),0,SERIES_SYNCHRONIZED))
           {
            //--- есть синхронизация, выходим
            synchronized=true;
            break;
           }
         //--- увеличим счетчик
         attempts++;
         //--- подождем 10 миллисекунд до следующей итерации
         Sleep(10);
        }
      //--- вышли из цикла по факту синхронизации
      if( synchronized)
        {
         Print("Количество баров в истории терминала по символу-периоду на данный момент = ",bars);
         Print("Самая первая в истории терминала дата по символу-периоду на данный момент = ",
               (datetime)SeriesInfoInteger(Symbol(),0,SERIES_FIRSTDATE));
         Print("Самая первая дата в истории по символу на сервере = ",
               (datetime)SeriesInfoInteger(Symbol(),0,SERIES_SERVER_FIRSTDATE));
        }
      //--- синхронизация данных так и не была достигнута
      else
        {
         Print("Не удалось получить количество баров на ",_Symbol);
        }
     }

Condition

if(synchronized)

highlighted in red. This entry corresponds to

if(synchronized==true)
? Because it's inside the same function? How does it guess to check for truth?
 
Silent:

? Because inside of one function?

first of all if is not a function

How does it guess that it has to be checked for the truth?

and how does it guess that

if (K>0)

does it have to check for truth?

Do you think it would be more convenient if ((K>0)==true) ?

 
sergeev:

first of all if is not a function

Oops. OK. Operator.

sergeev:

And how does it guess that

if (K>0)

Should we check for truth?

Do you think it's more convenient if ((K>0)==true) ?

Because if (K>0) explicitly says what to compare it to: K to 0.

In the sample it is if (K).

What - K? K is initialized as false. As we go along, we have assigned true. Then we check - if (K). What - K...?

It turns out that for false it must explicitly write if (K!=false) but for true it does not?

I'm completely confused.

 
Silent:

...

I'm confused at last.

Read as follows:

if(K) - if K is true. You may write it in the following way: if(K==true)

if(!K) - if ( K==false ) - you may write it so: if(K==false)

 
tol64:

Read as follows:

if(K) - if K is true. You can write it like this: if(K==true)

if(!K) - if K is false. You may write it so: if(K==false)

Ah, just a short form of writing. Thank you.