Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 399

 
styrad:

What program? I have a real and demo account open

The "Demo version blocked" message cannot be displayed by the terminal. It is output by either an indicator or an Expert Advisor running on any of the terminal charts.

 
What is the line_id parameter in ObjectGetValueByTime?
 
RomanRott:
What is line_id parameter in ObjectGetValueByTime?

What does the Help say about this function?

Line number. An object can have several lines at the same time. The very first one has id 0.

If there is only one line, it is 0.

 
Artyom Trishkin:

What does the Help say about this function?

Line number. An object can have several lines at the same time. The very first one has id 0.

If there is only one line, it is 0.


Yes, exactly.
One more question. I have written a code for stop and take. In theory Take should be 2 times stop, but my robot sets 1 to 1, what is the problem? I'm multiplying by 2 the difference between High and Low

double Stop=High[1]+10*Point;
double Take=Low[1]-2*(High[1]-Low[1]);
 

Hi all. Can you please tell me if I can rely on the tester? I have run the Expert Advisor from this site 3 times in a row with optimized parameters, I have not changed any settings, and all three times different values in the tester. What am I doing wrong? Or do I need to use a third-party tester?

 
Shara1:

Hi all. Can you please tell me if I can rely on the tester? I have run the Expert Advisor from this site 3 times in a row with optimisation of parameters, I have not changed any settings, and all three times different values in the tester. What am I doing wrong? Or do I need to use a third-party tester?

You can trust the tester at your own risk. Different values may be due to the inclusion of today. Third party testers can be found - try and share.
 
STARIJ:
You can trust the tester at your own risk. Different values may be due to the inclusion of today. Find third party testers - try and share.

Thank you. I've raced three times one after the other. Are there any online testers?

 
Please help me to find an error.
Why is the Alert not printed after a loop?
#include <GBP\Koef.mqh>
#include <GBP\OBJECT.mqh>
void GBPUSD_EURUSD(int m, int bar, double k, color color1, color color2, color color3, color color4, color color5, string symbol_1, string symbol_2)
   {
   
   //----------------------------------------------------------------------------------------
   int s=25;
   int Xh[], Xv[], Yh[][25], Yv[][25];
   ArrayResize(Xh, s);
   ArrayResize(Yh, s);
   ArrayResize(Xv, s);
   ArrayResize(Yv, s);
   
   for(int i=0; i<=s; i++)
      {     
      Xh[i]=i*50+55;
      Xv[i]=i*15+25;
           
         for(int z=0; z<=s; z++)
            {            
            Yv[i][z]=Xh[i];
            Yh[i][z]=Xv[i]; 
            }                            
      } 
   Alert(Xh[0]);   
   //----------------------------------------------------------------------------------------
   
      
   int n=25;                             //n - количество измерений, m - количество элементов      
   double kef=Koef(m, bar, n, symbol_1, symbol_2);
   OBJECT(k, kef, color1, color2, color3, color4, color5, symbol_1, symbol_2, Xh[1], Yh[0][1], Xh[0], Yh[1][0]);
   } 

The for(int z...) loop outputs the correct message:

...
for(int z=0; z<=s; z++)
            {            
            Yv[i][z]=Xh[i];
            Yh[i][z]=Xv[i]; 
            Alert(Xh[0]); 
            }                            
 
   

after it and after the for(int i...) loop - no way.
Note that everything is okay in a separate script. Where is the error?

 
Timur1988:
Please help me to find an error.
Why does not "Alert" appear after a loop?

The for(int z...) loop outputs the correct message:

after it and after the for(int i...) loop - no way.
Note that everything is okay in a separate script. Where is the error?

Look at the Experts tab: array out of range in ... The array is described as 25 elements. In the loop, the index varies from 0 to 25, 26 in total. After an error occurs, program execution stops. If you insert Alert inside the loop and add the output of the element number, it becomes clear
 
mila.com:

Thanks)
Not to rewrite, maybe you can overlay the trend lines on those segments that are >=100pts.

Can you tell me how to set coordinates for trendline points to plot it from trough to top of zigzag -a.

I came across this on the blue forum.


Download. I haven't looked at what this miracle is myself.

Reason: