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

 
MakarFX #:

From the screenshot, these conditions are not met

//+------------------------------------------------------------------+
//| Открытие ордера                                                  |
//+------------------------------------------------------------------+
void SendFirsOrder(int so=-1)
  {
   double tp=0;
   if(so==0)
     {
      if(OrderSend(Symbol(),OP_BUY, Lots(),Ask,slip,0, 0, "The first purchase order", Magic,0,clrBlue))
        {
         Print("Open Buy: ",_Symbol);
        }
      else
        {
         Print("Error Open Buy: ",_Symbol," / ",GetLastError());
        }
     }
   if(so==1)
     {
      if(OrderSend(Symbol(),OP_SELL, Lots(),Bid,slip,0, 0, "The first sell order", Magic,0,clrRed))
        {
         Print("Open Sell: ",_Symbol);
        }
      else
        {
         Print("Error Open Sell: ",_Symbol," / ",GetLastError());
        }
     }
  }
 
EVGENII SHELIPOV #:

How can a trawl work if you have OrderStopLoss() equal to 0 and in the condition

        if(OrderSymbol() == Symbol() && OrderMagicNumber() == Magic && OrderProfit() > 0 && OrderStopLoss() != 0)
 
Nerd Trader #:

It's not a problem for anyone to see.
If there is a blank line before and after the comment:

the id will insert



None of this really matters though, we just need to use a different ide.

Why use a blank line between the comment line and the function declaration?

 

Good afternoon!

I recently switched to MT5 and read a lot of articles, but did not find an answer to my question.

I have not found an answer to my question. MT5 allows me to enable "slow optimization" type (complete search of parameters). I have to select one tool for optimization.

Does MT5 have a function in the tester where you can select several symbols and optimize everything with them. I.e., try the first one first, then the second one, etc. And in the end, you will get a separate report for each symbol? Or maybe there are some other solutions for this question, or maybe there are other programs for this?

The idea is not to wait by the computer when the test tool is over. And immediately set all the necessary and let it count all day.

 
Kot optimization" type (complete search of parameters). I can select one tool for optimization.

Does MT5 have a function in the tester where you can select several symbols and optimize everything with them. I.e., try the first one first, then the second one, etc. And in the end, you will get a separate report for each symbol? Or maybe there are some other solutions for this question, or maybe there are other programs for this?

The idea is not to wait by the computer when the test tool is over. And immediately set all the necessary and let it count all day.

Run several terminals, one for each pair
 

When a button is released ignoring a condition, ObjectDelete() is always executed for some reason, even when the object is removed.

void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam)
{
   ...
  if(ObjectGetInteger(0,"Button Stop Order",OBJPROP_STATE)){
      if(ChartXYToTimePrice(window,x,y,window,dt,price)){
         ...
  }else if(ObjectFind("order setup") || ObjectFind("Stop Loss"))
      Print(line_name," delete ",ObjectDelete(line_name)," error ", GetLastError());

2021.12.05 21:43:14.040 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.040 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.030 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.030 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.030 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.030 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.030 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.020 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.020 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.020 USDCHF,M1: Stop Loss delete false error 0
2021.12.05 21:43:14.020 USDCHF,M1: Stop Loss delete false error 0
 
Alexey Viktorov #:

Why the blank line between the comment line and the function declaration?

So you're saying that when ide inserts some shit into your code without your consent, it's OK?
 
Nerd Trader a button is released ignoring a condition, ObjectDelete() is always executed for some reason, even when the object is removed.
void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam)
{
   ...
  if(ObjectGetInteger(0,"Button Stop Order",OBJPROP_STATE)){
      if(ChartXYToTimePrice(window,x,y,window,dt,price)){
         ...
  }else if(ObjectFind("order setup")==0 || ObjectFind("Stop Loss")==0){
      Print(line_name," delete ",ObjectDelete(line_name)," error ", GetLastError());
 
MakarFX #:
Yeah, well, I've had it up to here.
 
Nerd Trader #:
Yeah, well, I'm really fucking sick of it.
I've written to you before.