Discussion of article "Create Your Own Trading Robot in 6 Steps!" - page 4

 

Very good article. Thanks for the help.

 

I must have searched badly, please point me in the direction of CCustom's description

I can't understand why, after creating a custom indicator, it is necessary to call the check (or is it a customisation of the indicator?):

//| Set number of buffers of indicator. |

//--- number of buffers
   if(!m_slow_ma.NumBuffers(1)) return(false);
//--- we have reached this point, it means that the function was executed successfully - return true
   
 
bivmail:

I must have searched badly, please point me in the direction of CCustom's description.

You have a misspelling. And right in the article there is a reference to CiCustom:

Of course, you can create your own indicator class, which will be a descendant of CIndicator and implement all the necessary methods for use with the MQL5 Wizard. But in this case, we want to show you how to use any custom indicator in the trading signals module using CiCustom.

 

good article

 

can't win... Help

I create a signaler from the example in the same catalogue, generate an Expert Advisor, everything works.

I generate an Expert Advisor based on my signaler, it shows a window with description and input parameters, I click OK, it fails:

2012.03.26 20:45:16 art367exp.ex5 Invalid EX5 file

I have already given different names, created a new signal file, copied the text there, both files compile normally, but the chart shows Invalid EX5 file.

I compare visually, everything seems to be in place. Where is the error? Build 572


	          
Files:
 
bivmail:

can't win... Help

I create a signaler from the example in the same catalogue, generate an Expert Advisor, everything works.

I generate an Expert Advisor based on my signaler, it shows a window with description and input parameters, I click OK, it fails:

2012.03.26 20:45:16 art367exp.ex5 Invalid EX5 file

I have already given different names, created a new signal file, copied the text there, both files compile normally, but the chart shows Invalid EX5 file.

I compare visually, everything seems to be in place. Where is the error? Build 572

We'll look into it (even OnInit() doesn't come).
 
uncleVic:
We'll look into it (even OnInit() doesn't come).
Try to update the terminal (current build is over 600 long ago)
 
uncleVic:
Try to update the terminal (current build is over 600 long ago)

I updated to 619 from 23 March, alfaforex does not offer any other.

The result is the same. I tried to put the signaler text directly into the Expert Advisor (instead of the include line), it compiles normally, but it doesn't work with the same error....

How can I find out the name of the file on which it stumbles?

I tried to put the first line printf(__FUNCTION__+": initializing expert") in onInit; there is no result, which, in fact, confirms the above....

it writes in the log:

2012.03.27 14:59:39 Experts expert art367biv (EURUSD,H1) loaded successfully

2012.03.27 14:59:41 Experts initializing of art367biv (EURUSD,H1) failed

2012.03.27 14:59:41 Experts experts art367biv (EURUSD,H1) removed

Apparently, we will have to line by line in order similar to the example.

Документация по MQL5: Стандартные константы, перечисления и структуры / Именованные константы / Предопределенные макроподстановки
Документация по MQL5: Стандартные константы, перечисления и структуры / Именованные константы / Предопределенные макроподстановки
  • www.mql5.com
Стандартные константы, перечисления и структуры / Именованные константы / Предопределенные макроподстановки - Документация по MQL5
 
bivmail:

I updated to 619 from 23 March, alfaforex does not offer any other.

The result is the same. I tried to put the signaler text directly into the Expert Advisor (instead of the include line), it compiles fine, but it doesn't work with the same error.

How can I find out the name of the file on which it stumbles?

I tried to put the first line printf(__FUNCTION__+": initializing expert") in onInit; there is no result, which, in fact, confirms the above....

it writes in the log:

2012.03.27 14:59:39 Experts expert art367biv (EURUSD,H1) loaded successfully

2012.03.27 14:59:41 Experts initializing of art367biv (EURUSD,H1) failed

2012.03.27 14:59:41 Experts experts art367biv (EURUSD,H1) removed

Apparently, we will have to line by line in order similar to the example.


Thank you. Thanks to your programming, we found an error in the compiler.

You have:

   bool GetFastMA(const int index) const{ return(m_fast_ma.GetData(0,index));}
   bool GetSlowMA(const int index) const{ return(m_slow_ma.GetData(0,index));}

You need:

   double GetFastMA(const int index) const{ return(m_fast_ma.GetData(0,index));}
   double GetSlowMA(const int index) const{ return(m_slow_ma.GetData(0,index));}
 

Another mistake (yours):

//--- object initialisation 
   if(!m_fast_ma m_slow_ma.Create(m_symbol.Name(),m_period,IND_CUSTOM,4,parameters))
     {
      printf(__FUNCTION__+": slow MA object initialisation error");
      return(false);
     }
//--- number of buffers
   if(!m_slow_ma.NumBuffers(1)) return(false);

I'll see how to guard against this in the Library.