Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 527

 

Good day Dear Sirs!

Since I'm just getting familiar with the MQL language, there is a disproportionate number of questions to the answers, so my question is as follows: How to create a simple script/advisor to execute an order on a daily opening for several currency pairs?

 
AlexMikash:

Good day Dear Sirs!

Since I'm just getting familiar with the MQL language, there is a disproportionate ratio of questions to answers, so my question is as follows: How to create a simple script/advisor so that an order is executed on a daily opening on multiple currency pairs?

Start with one pair first. Or even just by creating a Hello world script.

ps. corrected, but in the context of a mono-pypical.

 

Metaeditor gives an error in the line in bold, namely:'Point' - an operator expected, ',' - parameter expected. What is the problem?

Thank you in advance.


//--------------------------------------------------------------------
// GBRUSD.mq4.
// Intended to be used as an example in the MQL4 tutorial.
//--------------------------------------------------------------------
int start() // Special function start
{
double Level=1.67100; // set price level.
int Delta=NormalizeDouble((Bid-Level)Point,0); // Exceeded
if (Delta<=0) // Price is not above level
{
Alert("Price is below the level"); // Message
return; // Exit()
}
//--------------------------------------------------------------------
switch(Delta) // Header switch
{ //beginning of the body switch
case 1 : Alert("Plus one point"); break;// Options.
case 2 : Alert("Plus two points"); break;
case 3 : Alert("Plus three points"); break;
case 4 : Alert("Plus four points"); break;//
case 5 : Alert("Plus five points"); break;//10 variations of the case,
case 6 : Alert("Plus six points"); break;//but in the general case
case 7 : Alert("Plus seven points"); break;//single case
case 8 : Alert("Plus eight points");break;//unlimited
case 9 : Alert("Plus nine points");break;
case 10 : Alert("Plus ten points");break;
default: Alert("More than ten points"); // no case
} // end of body switch
//--------------------------------------------------------------------
return; // exit start()
}
 
AlexMikash:

Metaeditor gives an error in the line in bold, namely: 'Point' - an operator expected, ',' - parameter expected. What is the problem?

Thank you in advance.




int Delta=NormalizeDouble((Bid-Level)/Point,0); // Превышение
 
Yes, in that line.
 
AlexMikash:
Yes, in that line.

Can't you see the difference?
 
AlexMikash:
Yes, in that line).

To the oculist... /Point

 
AlexeyVik:

To the oculist... /Point



Guys, I get it, let's not make too many comments. Thank you.
 

I'm not getting any error codes processed in the strategy tester. What's wrong there? Is there a problem with Sleep or are the errors just not being generated?

 
tara:

Yevgeni Nikolaevichs from Odessa (you asked the plural yourself) - can you answer?
Strange people... I just wanted an answer...
Reason: