Советники: Open by iMACD Close by iSAR

 

Open by iMACD Close by iSAR:

Открытие по сигналам индикатора iMACD (Moving Average Convergence/Divergence, MACD), закрытие по индикатору iSAR (Parabolic SAR, SAR)

Open by iMACD Close by iSAR

Автор: Vladimir Karputov

 

I have a question about the for loop starting from line 321. You have a number of   return   statements in this loop, such as in line 329, 335, 359, and so on. Should you use   continue   instead?

 
dipnqd:

I have a question about the for loop starting from line 321. You have a number of   return   statements in this loop, such as in line 329, 335, 359, and so on. Should you use   continue   instead?

Нет. Только 'return'!

 
Vladimir Karputov :

Not. Only 'return'!

Can you please explain? (I just need to understand the logic)

 
dipnqd:

Can you please explain? (I just need to understand the logic)

Если флаг "ожидание транзакции" взведён - то может быть Два состояния: транзакция ИЛИ подтверждена ИЛИ не подтверждена. 

 
Vladimir Karputov :

If the "pending transaction" flag is set, then there can be two states: the transaction is OR confirmed OR not confirmed. 

which one is the "pending transaction" flag?

 
dipnqd:

which one is the "pending transaction" flag?

Эта информация есть в описании структуры:

//+------------------------------------------------------------------+
//| Structure Positions                                              |
//+------------------------------------------------------------------+
struct STRUCT_POSITION
  {
   ENUM_POSITION_TYPE pos_type;              // position type
   bool              waiting_transaction;    // waiting transaction, "true" -> it's forbidden to trade, we expect a transaction
   ulong             waiting_order_ticket;   // waiting order ticket, ticket of the expected order
   bool              transaction_confirmed;  // transaction confirmed, "true" -> transaction confirmed
   //--- Constructor
                     STRUCT_POSITION()
     {
      pos_type                   = WRONG_VALUE;
      waiting_transaction        = false;
      waiting_order_ticket       = 0;
      transaction_confirmed      = false;
     }
  };