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

 
ExtZigzagBuffer[i]=lasthigh;
ExtZigzagBuffer[i]=lastlow;
 
Please tell me how to understand !IsStopped?
   for(shift=start; shift<rates_total && !IsStopped(); shift++)
     {
      //--- low
      val=low[Lowest(low,Inp

  ...



 
Dzmitry Zaitsau:
Please tell me how to understand !IsStopped?

if expert/script is deleted (user has closed the chart or deleted the expert)

the value returned by IsStopped() will be true, in the normal case, IsStopped() returns false

Boolean NOT - ! performs an inversion of a boolean value, i.e. ! false = true and ! true = false

 
Igor Makanu:

.... performs an inversion of a boolean value, i.e. ! false = true and ! true = false


I don't understand, if the EA is closed or deleted, how is the iteration performed at all and will it be possible to reach this condition?

 
Dzmitry Zaitsau:

I don't understand, if Expert Advisor is closed or removed, how is the iteration executed at all and will it be possible to reach this condition?

If the Expert Advisor is removed or the terminal is closed while the loop is running, the loop is terminated without starting the next iteration.

 
Alexey Viktorov:

If the Expert Advisor is removed or the terminal is closed while the cycle is in progress, the cycle is terminated without starting the next iteration.

Got it, thanks ))) have a good day!!!
 

Good day to all!

Please help a newbie to write a function!

I need a function to check (whether orders were opened on the current day and at what time), no matter how many and on which pairs.

The idea is this: when the EA reaches a certain profit it closes all open orders in the terminal automatically.

Then it should disable the auto-trading. And here is the problem!!! You need to find out if the orders were opened today or not.

If they were, then you can disable autotrading.

 
Tsaryoff5614:

Good day to all!

Please help a newbie to write a function!

I need a function to check (whether orders were opened on the current day and at what time), no matter how many and on which pairs.

The idea is this: when the EA reaches a certain profit it closes all open orders in the terminal automatically.

Then it should disable the auto-trading. And here is the problem!!! You need to find out if the orders were opened today or not.

If they were, you can disable autotrading.

Are you too lazy to use search?

This is the principle of creating such functions as you need

 

Thanks so much for the link!!!

I'll look into it))

 

Hi. Can you explain to a sucker how to initialise a structure array? For a normal array, it's simple

int HiddenFunc[3,2] = {1,2,3,4,5,6};

But what about the array of structures? Initialize an array with this structure, for example

struct MODE_KEY {string Key; bool Act;};

Reason: