[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 289

 
TheXpert >> :

Strictly speaking, no. But very close.

More specifically, where is it nearby?

I'd like to hear some thoughts on previous posts, about code, logic, etc.

>> thank you in advance.

 

Thank you for your attention.

This is what the EA looks like

//+------------------------------------------------------------------+
//| Bibliot.mq4 |
//| Copyright © 2009, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

#include <PointZigZag.mqh>

int init()
{return(0);}
int deinit()
{return(0);}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{PointZigZag();
Comment("Prod.-y21 = ",y21," ", "Pok.-x21 = ",x21);
return(0);
}
//+------------------------------------------------------------------+


And this is what the file looks like. It works in the terminal where it was created. But when compiling it writes -Start function not found and cannot be run.

//+------------------------------------------------------------------+
//| PointZigZag.mqh |
//| Copyright © 2009, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp.
#property link "http://www.metaquotes.net"
//+------------------------------------------------------------------+
//| EX4 imports |
//+------------------------------------------------------------------+
#import "PointZigZag.ex4".

extern inttern ExtDepth = 12; //------- variables ZigZag
extern inttern ExtDeviation = 5; //------- variables ZigZag
extern intBackstep = 3; //------- variables ZigZag
extern inttern ShiftBars = 2; //------- variables ZigZag
//------- variables ZigZag ------------------------------------------
double y3, y2, y1, zz;//
int x3, x2, x1, sh;//
double x31, x21, x11; // ZigZag inflection point
double y31, y21, y11; // ZigZag inflection point
double TimeZZ, TimeOO;
//------------------------------------------------------------------------------

double PointZigZag()
{y3=0;y2=0;y1=0;
sh=ShiftBars;
while (y3==0)
{zz=iCustom(NULL, 0, "ZigZag", ExtDepth, ExtDeviation, ExtBackstep, 0, sh);
if (zz!=0 && zz!=EMPTY_VALUE)
{if (y1==0) { x1=sh; y1=zz; }
else if (y2==0) { x2=sh; y2=zz; }
else if (y3==0) { x3=sh; y3=zz; }}sh++;
}
if (High[x1]>High[x2])
{x11=High[x1]; x21=Low[x2]; x31=High[x3];
y11=0;y21=0;y31=0;TimeZZ=Time[x2];
}else
{y11=Low[x1]; y21=High[x2]; y31=Low[x3];
x11=0;x21=0;x31=0;TimeZZ=Time[x2];}

}
#import
//+------------------------------------------------------------------+
 

I'm no expert, but the library files don't need to be compiled separately. Hence the message Start function not found and cannot be run. The library file will be automatically included in the code and compiled when compiling the EA (where there is a Start function).

Further it is not clear to me. I advise to comment out the #import "PointZigZag.ex4" and #import. It should work.

 

Better still, put it all together in an EA. and throw everything else away.

//+------------------------------------------------------------------+
//| Библиот.mq4 |
//| Copyright © 2009, MetaQuotes Software Corp. |
//| http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MetaQuotes Software Corp."
#property link "http://www.metaquotes.net"

extern int ExtDepth = 12; //------- переменные ZigZag
extern int ExtDeviation = 5; //------- переменные ZigZag
extern int ExtBackstep = 3; //------- переменные ZigZag
extern int ShiftBars = 2; //------- переменные ZigZag
//------- переменные ZigZag ------------------------------------------
double y3, y2, y1, zz;//
int x3, x2, x1, sh;//
double x31, x21, x11; // Точки перегиба ZigZag
double y31, y21, y11; // Точки перегиба ZigZag
double TimeZZ, TimeOO;
//------------------------------------------------------------------------------

int init()
{return(0);}
int deinit()
{return(0);}
//+------------------------------------------------------------------+
//| expert start function |
//+------------------------------------------------------------------+
int start()
{ PointZigZag();
Comment("Прод.-y21 = ", y21," ","Пок.-x21 = ", x21);
return(0);
}
double PointZigZag()
{ y3=0; y2=0; y1=0;
sh= ShiftBars;
while ( y3==0)
{ zz=iCustom(NULL, 0, "ZigZag", ExtDepth, ExtDeviation, ExtBackstep, 0, sh);
if ( zz!=0 && zz!=EMPTY_VALUE)
{if ( y1==0) { x1= sh; y1= zz; }
else if ( y2==0) { x2= sh; y2= zz; }
else if ( y3==0) { x3= sh; y3= zz; }} sh++;
}
if (High[ x1]>High[ x2])
{ x11=High[ x1]; x21=Low[ x2]; x31=High[ x3];
y11=0; y21=0; y31=0; TimeZZ=Time[ x2];
}else
{ y11=Low[ x1]; y21=High[ x2]; y31=Low[ x3];
x11=0; x21=0; x31=0; TimeZZ=Time[ x2];}

}
//+------------------------------------------------------------------+
 
granit77 >> :

Or, better yet, to collect them all together in an Expert Advisor, and throw away all the rest.

This is all understandable. But that was an abstract example.

I would simply like to create a library of different functions for other purposes, and then use them.

Please think some more about what could be the reason. >> Thank you.

 
gvi2504 >> :

This is all understandable. But that was an abstract example.

I would just like to create a library of different functions for other purposes, and then use them.

Please think again, what could be the reason. >> Thank you.

Thanks for the suggestion. I liked your last sentence so much, that I give it back to you. My guess is that the library file is not written correctly, there are #include and #import and a built-in function. It's buttery. Throw it away, read a textbook and write it again.

 

How do you people test your EAs, let's say in a range of one year? I've read so much information, but I cannot do anything about the fact that my M1 chart cannot go further than March 5, 2009. Correspondingly, I cannot set the testing period earlier than March 5. I have tried to load quotations to MT through the service->quotes archive, it does not help. Manual scrolling also does not help.... This is what I got from the technical support of brokerage company:


"Unfortunately, Metaquotes does not provide a special program, the so-called "historical server" to dealing centres, so there are these limitations. Also when you select menu "Service-Archive" and click "Download" - you will get the warning that historical data from MetaQuotes server will be downloaded.

p.s. Several dealing centres (and we are among them) tried to make MetaQuotes enable you to download data (without restrictions) from a particular brokerage company. However, so far they only promise to make this service available in MT5.


And what should I do if I want to check my Expert Advisor on a long run?

 
Noterday >> :

How do you people test your EAs, let's say in a range of one year? I've read so much information, but I cannot do anything about the fact that my M1 chart cannot go further than March 5, 2009. Correspondingly, I cannot set the testing period earlier than March 5. I have tried to load quotations to MT through the service->quotes archive, it does not help. Manual scrolling also does not help.... This is what I got from the technical support of my brokerage company:


"Unfortunately, Metaquotes does not provide a special program, the so-called "historical server" to dealing centres, so there are these limitations. Also when you select menu "Service-Archive" and click "Download" - you will get the warning that historical data from MetaQuotes server will be downloaded.

p.s. Several dealing centres (and we are among them) tried to make MetaQuotes enable you to download (without restrictions) data from a particular brokerage company. However, so far they only promise to make this service available in MT5".


And what should I do if I want to check my EA for a long period of time?

Moreover, in MT5 it is not just expected, there everything is built on М1 and the other TF is calculated from М1 (those history will be only in М1) Well, put a bigger window and download from MetaQuotes , otherwise there is no way. If you have not run MT before the start date and MQ, and you have not saved your own moves, no way.

Although ask who might have saved them, there are people who have saved quotes even since MT-2.

(I'm sorry, I don't know what happened before MT-2, but I haven't had much time in forex).

 
Load history and (write) test the Expert Advisor on "Opening prices" on at least n1...
 
rid >> :
Loading history and (writing) testing an EA on "Opening prices" on af, at least n1...

Yes indeed, started testing :) But something seems to me that because of such a mess the system won't show itself. Maybe the indicator is not calculated correctly on such data or something else ... especially since the system was designed for minutes. Thanks anyway!

Reason: