Download MetaTrader 5

help on new file .mqh

To add comments, please log in or register
Ronnie Mansolillo
5529
Ronnie Mansolillo  

Writing a new Signal file the "compile" module gives to me the following errors:

  Cihilo            m_ma;             // object-indicator    "DECLARATION WITHOUT TYPE"

  double            MA(int ind)                         { return(m_ma.Main(ind));  " UNDECLARED IDENTIFIER"

  if(!indicators.Add(GetPointer(m_ma)))  3 ERRORS "UNDECLARED IDENTIFIER" "PARAMETER CONVERSION NOT ALLOWED" "CLASS TYPE EXPECTED"

 

anyone can help me? 

Alain Verleyen
Moderator
31183
Alain Verleyen  
Rosiman:

Writing a new Signal file the "compile" module gives to me the following errors:

  Cihilo            m_ma;             // object-indicator    "DECLARATION WITHOUT TYPE"

  double            MA(int ind)                         { return(m_ma.Main(ind));  " UNDECLARED IDENTIFIER"

  if(!indicators.Add(GetPointer(m_ma)))  3 ERRORS "UNDECLARED IDENTIFIER" "PARAMETER CONVERSION NOT ALLOWED" "CLASS TYPE EXPECTED"

 

anyone can help me? 

Show your code.
Ronnie Mansolillo
5529
Ronnie Mansolillo  

I have solved   some errors it compares now only one shown in bold:

 //+------------------------------------------------------------------+

//| Create MA indicators.                                            |

//+------------------------------------------------------------------+

bool CSignalhilo::InitMA(CIndicators *indicators)

  {

//--- check pointer

   if(indicators==NULL)

      return(false);

//--- add indicator to collection

   if(!indicators.Add(GetPointer(m_close)))

     {

      printf(__FUNCTION__+": error adding object");

      return(false);

     }

//--- initialize indicator

   if(!m_ma.Create(m_symbol.Name(),m_period,m_ma_period,m_ma_shift,m_ma_applied))    "UNDECLARED IDENTIFIER"

     {

      printf(__FUNCTION__+": error initializing object");

      return(false);

     }

//--- ok

   return(true);

  }
Alain Verleyen
Moderator
31183
Alain Verleyen  
Please edit your post and use SRC button when you post code.
Ronnie Mansolillo
5529
Ronnie Mansolillo  
angevoyageur:
Please edit your post and use SRC button when you post code.
ok
Alain Verleyen
Moderator
31183
Alain Verleyen  
Rosiman:
ok
Why are you replying "ok" and don't do what I ask you ?
Ronnie Mansolillo
5529
Ronnie Mansolillo  
angevoyageur:
Why are you replying "ok" and don't do what I ask you ?
because I want to learn about rules and SRC button and source code,I don't have any idea and need some little time to do it, but first I need to spend time with my kids on this sunday. excuse me again.
Ronnie Mansolillo
5529
Ronnie Mansolillo  
//+------------------------------------------------------------------+
//| Create MA indicators.                                            |
//+------------------------------------------------------------------+
bool CSignalhilo::InitMA(CIndicators *indicators)
  {
//--- check pointer
   if(indicators==NULL)
      return(false);
//--- add indicator to collection
   if(!indicators.Add(GetPointer(m_close)))
     {
      printf(__FUNCTION__+": error adding object");
      return(false);
     }
//--- initialize indicator
   if(!m_ma.Create(m_symbol.Name(),m_period,m_ma_period,m_ma_shift,m_ma_applied)) 
     {
      printf(__FUNCTION__+": error initializing object");
      return(false);
     }
//--- ok
   return(true);

the error message:

'm_ma' - undeclared identifier hilo.mqh 148 8

 


Alain Verleyen
Moderator
31183
Alain Verleyen  
Rosiman:
because I want to learn about rules and SRC button and source code,I don't have any idea and need some little time to do it, but first I need to spend time with my kids on this sunday. excuse me again.
Ok, not a problem. Seems you don't understand what I mean. I asked you to EDIT your previous message, anyway I edited it for you.
Ronnie Mansolillo
5529
Ronnie Mansolillo  
angevoyageur:
Ok, not a problem. Seems you don't understand what I mean. I asked you to EDIT your previous message, anyway I edited it for you.

So SRC button is used all the times we need to insert external parameters such as scripts? 

Simon Gniadkowski
Moderator
18003
Simon Gniadkowski  
Rosiman:

So SRC button is used all the times we need to insert external parameters such as scripts? 

SRC button is used when you need to post any  SouRCe code . . .  How to use the SRC button.
12
To add comments, please log in or register