[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 756

 
ToLik_SRGV:

Ilya, I'll have a look, but I don't quite understand why arrays have the string type?

it's a working variant for now :)

In fact, I would like to clarify:

Is there a similar "structure" in mql as in c.

I need to store in the given array the data of different types - date + time of extremum formation, as well as the value of extremum itself...

Accordingly, I wanted to clarify - is there a standard function for converting string into date+time... or how can this situation be bypassed?

 

Take this ZZ and don't worry about it.

Files:
zigzag2_r_.mq4  10 kb
 
Morzh09:

I apologize for repeating myself, but I'd really like to understand...


What immediately struck my eye, your array Number_of_extremum[] is not initialized anywhere, respectively, it has no cells for storing data, and you're trying to write min/max into it (of course, this always ends up 0). I suggest this option - dynamically change the size of the array depending on the K variable:

        
   }
   
//====================================================  

   ArrayResize(Number_of_extremum, k);
   
   for (int u=0;u<k;u++)//
   {
      if (StrToDouble(TimeSave1[u+1][1])<=StrToDouble(TimeSave1[u][1]))
      {
         Number_of_extremum[u]=1;// значит под номером u - нашли min
      }
      else
      if (StrToDouble(TimeSave1[u+1][1])>=StrToDouble(TimeSave1[u][1]))
      {
         Number_of_extremum[u]=2;// значит под номером u - нашли max
      }
   }
   
//====================================================   

It seems to work, although I think somewhere in the logic is still a bug, sometimes the numbers start to go out of sequence, but can there be two consecutive maxes?

 
ToLik_SRGV:

What did you want to achieve in the end?

If I've calculated correctly:
1000*60*(240+1)*1000 = 14 460 000 seconds.

Do you want the tester to pause on every tick for 167 days?

About the pause, I said a few pages ago.

Thanks, it's about right - Sleep doesn't work in the tester. This impossibly long delay I set to check if sleep works at all.
 

Hi. There is an arbitrage strategy, is it perfect? I.e. is it unreal to lose on it or does the price not always reach the right level?

Thank you

 
Swetten:

What is the maximum number of windows in MT4?

I needed to open 3x19 windows, but it's 54 (I think) and that's it.

I.e. the window is drawn, but it has a screenshot of the previous (which are in the background) windows.

And that's it.

It happens when there's not enough video memory...
 

Please advise which code should be added to the Expert Advisor, so it would stop at breakeven after a profit of at least 20 pips and would not move it anymore

I will be very grateful for your feedback

 

Colleagues, can you tell me if there is an indicator that consists of three parallel horizontal lines, i.e. a kind of channel. For example, if you take a horizontal line, put it at some level, and from this line after a certain (given) number of points is drawing the other lines parallel to it. I thank you in advance.

 

In the tester, the Expert Advisor opens 5 orders during the selected period.

If we change the OrderSend(Symbol(),OP_BUY, Lots,Ask,3,Ask-10*Point,0,"", 0,0,Blue); replacing 10 with 15, then 4 orders out of 5 will be opened, and if we replace 10 with 20, then only 3 will be opened. At the same time,

only losing orders which are closed by Stop Loss. You don't see any error messages. What is the reason for this, please?

And the feeling is that it doesn't even get into this branch.

if (OrdersTotal()!=0) {
   if (OrderType()==OP_BUY && stochMain0<stochSIGNAL0) CLOSEORDER("Buy");     
   if (OrderType()==OP_SELL && stochMain0>stochSIGNAL0) CLOSEORDER("Sell");  
}
else {
   double MA0 = iMA(NULL,timeframe,Period_MA,0,MODE_SMA, PRICE_OPEN,0);   
   double MA1 = iMA(NULL,timeframe,Period_MA,0,MODE_SMA, PRICE_OPEN,Shift);   
   double MA2 = iMA(NULL,timeframe,Period_MA,0,MODE_SMA, PRICE_OPEN,Shift*2); 
   if (MA0>MA1-razn1 && MA1>MA2-razn1 && MA0<Ask)    
      if(stochMain0>stochSIGNAL0 && stochMain_1>stochSIGNAL_1 && stochMain_4<stochSIGNAL_4) {
         //OPENORDER ("Buy");
         OrderSend(Symbol(),OP_BUY, Lots,Ask,3,Ask-10*Point,0,"", 0,0,Blue);
      }
   else if (MA0+razn1<MA1 && MA1+razn1<MA2 && MA0>Bid)     
      if(stochMain0<stochSIGNAL0 && stochMain_1<stochSIGNAL_1 && stochMain_4>stochSIGNAL_4)  //   
         {OPENORDER ("Sell");  }
}     
Files:
stoch_1.mq4  7 kb
 
profitinvesting:

Please advise which code should be added to the Expert Advisor, so it would stop at breakeven after a profit of at least 20 pips and would not move it anymore

I will be very grateful for your feedback

Do you need the total profit of all open positions or you want to put a stop on each of them when they reach 20 points of profit?
Reason: