Discussão do artigo "Biblioteca para desenvolvimento fácil e rápido de programas para a MetaTrader (parte I). Conceito, gerenciamento de dados e primeiros resultados" - página 6

 
pennyhunter:

Muito obrigado!

Eu sou relativamente novo em programação e estava com medo de seus artigos porque eles parecem tão enigmáticos e não têm imagens neles AHAHAHAHA.

Mas não, na verdade eles são muito bem escritos e bem traduzidos, e estão me ajudando a entrar na programação orientada a objetos.

:)

OK. Seja bem-vindo

 

Aparentemente ocorre um erro no seguinte trecho:

+------------------------------------------------------------------+
| Retorna a flag de fechamento da posição por StopLoss             |
+------------------------------------------------------------------+
bool COrder::OrderCloseByStopLoss(void) const
  {
#ifdef __MQL4__
   return(::StringFind(::OrderComment(),"[sl")>WRONG_VALUE);
#else
   return
     (
    this.Status()==ORDER_STATUS_HISTORY_ORDER ? this.OrderReason()==ORDER_REASON_SL :
     this.Status()==ORDER_STATUS_DEAL ? this.OrderReason()==DEAL_REASON_SL : false
     );
#endif
  }
//+------------------------------------------------------------------+
//| Retorna a flag de fechamento da posição pelo TakeProfit          |
//+------------------------------------------------------------------+
bool COrder::OrderCloseByTakeProfit(void) const
  {
#ifdef __MQL4__
   return(::StringFind(::OrderComment(),"[tp")>WRONG_VALUE);
#else
   return
     (
      this.Status()==ORDER_STATUS_HISTORY_ORDER ? this.OrderReason()==ORDER_REASON_TP :
      this.Status()==ORDER_STATUS_DEAL ? this.OrderReason()==DEAL_REASON_TP : false
     );
#endif
  }

A mensagem retornada é: 'Status' - undeclared identifier    Order.mqh  

Infelizmente não estou conseguindo resolver.

Obrigado. 

 
albertpess:

Aparentemente ocorre um erro no seguinte trecho:

+------------------------------------------------------------------+
| Retorna a flag de fechamento da posição por StopLoss             |
+------------------------------------------------------------------+
bool COrder::OrderCloseByStopLoss(void) const
  {
#ifdef __MQL4__
   return(::StringFind(::OrderComment(),"[sl")>WRONG_VALUE);
#else
   return
     (
    this.Status()==ORDER_STATUS_HISTORY_ORDER ? this.OrderReason()==ORDER_REASON_SL :
     this.Status()==ORDER_STATUS_DEAL ? this.OrderReason()==DEAL_REASON_SL : false
     );
#endif
  }
//+------------------------------------------------------------------+
//| Retorna a flag de fechamento da posição pelo TakeProfit          |
//+------------------------------------------------------------------+
bool COrder::OrderCloseByTakeProfit(void) const
  {
#ifdef __MQL4__
   return(::StringFind(::OrderComment(),"[tp")>WRONG_VALUE);
#else
   return
     (
      this.Status()==ORDER_STATUS_HISTORY_ORDER ? this.OrderReason()==ORDER_REASON_TP :
      this.Status()==ORDER_STATUS_DEAL ? this.OrderReason()==DEAL_REASON_TP : false
     );
#endif
  }

A mensagem retornada é: 'Status' - undeclared identifier    Order.mqh  

Infelizmente não estou conseguindo resolver.

Obrigado. 

MetaTrader 4 ? or MetaTrader 5 ?

 

O mesmo ocorre em:

m_long_prop[ORDER_PROP_PROFIT_PT]                           = this.ProfitInPoints();

e

m_double_prop[this.IndexProp(ORDER_PROP_PROFIT_FULL)]       = this.ProfitFull();

Ambos os trechos dentro do Construtor paramétrico Closed 

Obrigado

 
Artyom Trishkin:

MetaTrader 4 ? or MetaTrader 5 ?

MT5
 
albertpess :
MT5

I would like to know what you are doing.

Please insert the code using this button on the toolbar of the message input window

 

Estou estudando seus artigos. Meu objetivo é aprender a trabalhar com classes.

 
Artyom Trishkin:

I would like to know what you are doing.

Please insert the code using this button on the toolbar of the message input window

bool COrder::OrderCloseByStopLoss(void) const
  {
#ifdef __MQL4__
   return(::StringFind(::OrderComment(),"[sl")>WRONG_VALUE);
#else 
   return
     (
     this.Status()==ORDER_STATUS_HISTORY_ORDER ? this.OrderReason()==ORDER_REASON_SL : 
     this.Status()==ORDER_STATUS_DEAL ? this.OrderReason()==DEAL_REASON_SL : false
     );
#endif 
  }
//+------------------------------------------------------------------+
//| Retorna a flag de fechamento da posição pelo TakeProfit          |
//+------------------------------------------------------------------+
bool COrder::OrderCloseByTakeProfit(void) const
  {
#ifdef __MQL4__
   return(::StringFind(::OrderComment(),"[tp")>WRONG_VALUE);
#else 
   return
     (
      this.Status()==ORDER_STATUS_HISTORY_ORDER ? this.OrderReason()==ORDER_REASON_TP : 
      this.Status()==ORDER_STATUS_DEAL ? this.OrderReason()==DEAL_REASON_TP : false
     );
#endif 
  }
 

Спасибо.

Я не знал об этой функции.

 
albertpess :

Estou estudando seus artigos. Meu objetivo é aprender a trabalhar com classes.

Is the test program included with the article working?
What errors occur?
Please describe in more detail.