if(true)

 

Strange design, what does it mean?

Maybe there is a hidden meaning that I don't know?

 
Sergey Chalyshev:

Strange design, what does it mean?

Maybe there is a hidden meaning that I don't know?

if(1)

Thebooltype is intended to store the boolean valuestrue orfalse, whose numeric representation is 1 or 0, respectively.

 
Sergey Chalyshev:

Strange design, what does it mean?

Maybe there is a hidden meaning that I don't know?

Making a block. Making bare brackets

{
  //code
} // данные уничтожатся при выходе (умные указатели, файлы, другие ресурсы)

is not a good idea.

 
Sergey Chalyshev:

Strange design, what does it mean?

Maybe there's a hidden meaning I don't know?

There is a hidden meaning. Probably, at first there was something instead of true, then they decided to experiment - to remove the expression, but not to break everything, they left the construct itself, in case we have to go back.

 
Roman:

if(1)

Thebooltype is intended to store the logical valuestrue orfalse, whose numeric representation is 1 or 0, respectively.

true orfalse is clear.

What do you mean

if(1)

?

 
Dmitry Fedoseev:

There is a hidden meaning. Probably first there was something instead of true, then they decided to experiment - to remove the expression, but not to break everything, they left the structure itself, in case we have to go back.

Looks like it, but this is the final code,

a little wider:

      //----- Set
      if(true)
         printf("Symbol %s trade exe %s",symb,EnumToString((ENUM_SYMBOL_TRADE_EXECUTION)SymbolInfoInteger(symb, SYMBOL_TRADE_EXEMODE)));
      ExtTrade.PositionOpen(symb, (is_buy?ORDER_TYPE_BUY:ORDER_TYPE_SELL), _lot, pr_opn, NormalizeDouble(SL,dig), 0.0, comm);
      //while(ExtTrade.ResultRetcode()==0) Sleep(10);
      if(true)
         PrintFormat("Тикет открытой сделки: %d; Тикет открытого ордера: %d",ExtTrade.ResultDeal(),ExtTrade.ResultOrder());
      ulong tic = ExtTrade.ResultOrder();
      //if(ExtTrade.ResultRetcode()==10009) break;
 
Sergey Chalyshev:

Strange design, what does it mean?

Maybe there is a hidden meaning that I don't know?

It is analogous to the same operation, with the possibility of increasing or decreasing its duration and/or result

 
aleger:

This is analogous to the same operation, with a possible increase or decrease in its duration and/or result

I don't understand, can you elaborate?

 
Sergey Chalyshev:

Looks like it, but this is the final code,

a little wider:

There must have been a template, and instead of true there was an external variable that included log output. But since there was no such variable in the task, it was deleted. And as programmers are practical people, it was not removed at all, it was left easy to return it.

 
Sergey Chalyshev:

Strange design, what does it mean?

Maybe there's a hidden meaning I don't know?

Don't like it?

if(true)

Write it :)

if(4<5)
 
Sergey Chalyshev:

Strange design, what does it mean?

Maybe there is a hidden meaning that I don't know?

true is sometimes false

but what is being analysed?

the code is wrong to put it mildly and the condition is at least missing either a variable or a comparison

Reason: