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

 

Hi all. Can you advise me where to write about the bug in MT5 after the update two weeks ago?


The point is this. When I opened positions and hovered over SL and TP, the data window (the window that shows the fact of SL and TP) is not displayed or opens very slowly. I tried with several computers in different accounts. I feel it only happens when I have more than one window in my terminal. I did not have this problem before.

I'm not sure how to use it and I'm not sure what to do with it.

Files:
 
Artyom Trishkin:

Create a new global variable. Set the value of the input parameter Inp_element_2542795 to it:

and replace the entire entry of the string Inp_element_2542795 with this new variable g_element_2542795 using Ctrl + H

Still the question remains the same. The EA is working on its own. I am not getting the point where this global variable will help. I tried changing it but the 400 remains the same. I tried changing to 200, it is constant to 200. But I want that the EA should be able to decide what point should get applied.

 
jaffer wilson :

Still the question remains the same. The EA is working on its own. I am not getting the point where this global variable will help. I tried changing it but the 400 remains the same. I tried changing to 200, it is constant to 200. But I want that the EA should be able to decide what point should get applied.

If you want the adviser to change a variable, then it should change the g_element_2542795 variable. It gets the value of the variable Inp_element_2542795 upon initialization, and then in the adviser you can change it as you like.

 

Why doesn't it work like that?

int massiv[OrdersTotal()];
 
igrok333:

Why doesn't it work like that?

Stroustrup and Ritchie wanted it that way.
 
igrok333:

Why doesn't it work?

It would be surprising if it did.

 
igrok333:

Why doesn't it work like that?

Using arrayresize will work
 

Please help, just getting started...
How do I make a condition-based lot size determination? I wrote this, but it does not work.

double lot()
{
if((Ask <= L0a3) || (Ask <= L2a3) || (Ask <= L5a3) || (Ask <= L8a3) || (Bid >= L0b1) || (Bid > = L2b1) ||
(Bid >= L5b1) || (Bid >= L8b1))
lot=(NormalizeDouble(Lots, 2))

if((Ask <= L0a) || (Ask <= L2a) || (Ask <= L5a) || (Ask <= L8a) || (Bid >= L0b) || (Bid >= L2b) ||
(Bid >= L5b) || (Bid >= L8b))
lot=(NormalizeDouble((Lots*1.5), 2))

if((Ask <= L0a1) || (Ask <= L2a1) || (Ask <= L5a1) || (Ask <= L8a1) || (Bid >= L0b3) ||
(Bid >= L2b3) || (Bid >= L5b3) || (Bid >= L8b3))
lot=(NormalizeDouble((Lots*2.5), 2));
return lot;
}

 
wolder1:

Please help, just getting started...
How do I make a condition-based lot size determination? Wrote this but something doesn't work.

double lot()
{
if((Ask <= L0a3) || (Ask <= L2a3) || (Ask <= L5a3) || (Ask <= L8a3) || (Bid >= L0b1) || (Bid >= L2b1) ||
(Bid >= L5b1) || (Bid >= L8b1))
lot=(NormalizeDouble(Lots, 2))

if((Ask <= L0a) || (Ask <= L2a) || (Ask <= L5a) || (Ask <= L8a) || (Bid >= L0b) || (Bid >= L2b) ||
(Bid >= L5b) || (Bid >= L8b))
lot=(NormalizeDouble((Lots*1.5), 2))

if((Ask <= L0a1) || (Ask <= L2a1) || (Ask <= L5a1) || (Ask <= L8a1) || (Bid >= L0b3) ||
(Bid >= L2b3) || (Bid >= L5b3) || (Bid >= L8b3))
lot=(NormalizeDouble((Lots*2.5), 2))
return lot;
}

you have a confusion about variables and functions, if it's a function, try it this way:

insert the code with ALT + S

double _LOTS()
  {
   double lot=0;
   if((Ask <= L0a3) || (Ask <= L2a3) || (Ask <= L5a3) || (Ask <= L8a3) || (Bid >= L0b1) || (Bid > = L2b1) ||
      (Bid >= L5b1) || (Bid >= L8b1))
      {
       lot=(NormalizeDouble(Lots, 2));
       Print(" lot = ", lot); 
       return(lot);
      }
      
    if((Ask <= L0a) || (Ask <= L2a) || (Ask <= L5a) || (Ask <= L8a) || (Bid >= L0b) || (Bid >= L2b) ||
      (Bid >= L5b) || (Bid > = L8b))
      {
       lot=(NormalizeDouble((Lots*1.5), 2));
       Print(" lot = ", lot); 
       return(lot);
      }
     
    

   if((Ask <= L0a1) || (Ask <= L2a1) || (Ask <= L5a1) || (Ask <= L8a1) || (Bid >= L0b3) ||
      (Bid >= L2b3) || (Bid >= L5b3) || (Bid >= L8b3))      
      {
       lot=(NormalizeDouble((Lots*2.5), 2));
       Print(" lot = ", lot); 
       return(lot);
      }
  } 
 
Simple question. The owl doesn't compile. There is an error at the end of the code. + __FUNCSIG__
+ ": "+Market_Err_To_Str(errIndex)
+ "; order ticket = " + (string)OrderTicket()
+ "; order type = " + (string)OrderType()
+ "; order Stop Loss = " + DoubleToStr(OrderStopLoss(), Digits())
+ "; new Stop Loss = " + DoubleToStr(newStopLoss, Digits())
+ "; Bid = " + DoubleToStr(Bid, Digits())
+ "; Ask = " + DoubleToStr(Ask, Digits())
);
}
}
lastSetNonlosTryTime = TimeLocal();
}


Throws a compile-time error. Please help if you can. Thank you!