MetaTrader 4 Build 529 beta released with new compiler - page 126

 
Wahoo:


The physical meaning is to check that the symbol whose name is entered as a string in the input parameters of the EA is available to trade. Identical code in MT5 works.

The code I gave you is just an example. It's a little different, but the meaning doesn't change.

P.S. What about error 138 in the tester?

Code:

Result:

Check:

if (OrderSend(SYMBOL,OP_BUY,0.1,NormalizeDouble(ask,digits),1000,0,0,"Test",0,0,CLR_NONE)<0) {
   Print("ask = "+DoubleToStr(ask,Digits)+", bid = "+DoubleToStr(bid,Digits)+", digits = "+digits);
   }
What's stopping you from looking at the cause?
 
Renat:
It means that pass results were useless and discarded.


Thank you for the translation. I was struggling with the translation, couldn't understand it...

But the old build takes about 3 hours to optimize and finds about 2000 profitable EA parameters. The new build optimizes normally for half a minute or even less at first, finds profitable parameters and then abruptly breaks and finishes the optimization.

I repeat, I wrote about this strange optimization behavior about a month ago. It seems to have been fixed. Now I have the same problem.

 
artmedia70:

Check:

What's stopping you from seeing the cause?


There is nothing in the way.

void OnTick()
  {
   if(OrdersTotal()==0)
     {
      string SYMBOL=Symbol();
      int digits=(int)SymbolInfoInteger(SYMBOL,SYMBOL_DIGITS);
      MqlTick lasttick={0};
      if(!SymbolInfoTick(SYMBOL,lasttick))
         return;
      double ask=lasttick.ask;
      double bid=lasttick.bid;

      if(OrderSend(SYMBOL,OP_BUY,0.1,NormalizeDouble(ask,digits),1000,0,0,"Test",0,0,CLR_NONE)<0) 
        {
         Print("ask = "+DoubleToStr(ask,Digits)+", bid = "+DoubleToStr(bid,Digits)+", digits = "+(string)digits);
        }
     }
  }

 
Question to Metacquotes: Why change iVolume type from double to ulong??? Why was it necessary to change the type of only one technical indicator??? Why couldn't it be left as it was?
 
Wahoo:


There's nothing in the way.


Anyway, here goes. SymbolInfoTick seems to be still a bit crooked (it seems to copy the REAL last price, not from the history):

void OnTick()
  {
   if(OrdersTotal()==0)
     {
      string SYMBOL=Symbol();
      int digits=(int)SymbolInfoInteger(SYMBOL,SYMBOL_DIGITS);
      MqlTick lasttick={0};
      if(!SymbolInfoTick(SYMBOL,lasttick))
         return;
      double ask=lasttick.ask;
      double bid=lasttick.bid;

      if(OrderSend(SYMBOL,OP_BUY,0.1,NormalizeDouble(ask,digits),1000,0,0,"Test",0,0,CLR_NONE)<0)
        {
         Print(SYMBOL+" ask = "+DoubleToStr(ask,Digits)+", bid = "+DoubleToStr(bid,Digits)+", digits = "+(string)digits);
         if(OrderSend(Symbol(),OP_BUY,0.1,NormalizeDouble(Ask,Digits),100,0,0,"Test",0,0,CLR_NONE)>0)
            Print("Opened using Ask ="+DoubleToStr(Ask,Digits));
        }

      //=== Final Check
      SymbolInfoTick(SYMBOL,lasttick);
      Print("Ask: "+(string)Ask+"  lastick.ask: "+(string)lasttick.ask);

     }
  }

Result:

 
Volume had to be changed for the sake of MT5 compatibility. The internal bars in MT4 are now the same as in 5.
 
Renat:
I had to change the Volume for the sake of compatibility with MT5. Now the internal bars in MT4 are the same as in 5.

This can't be the reason for the strong discrepancy between the test results on your demo account and, for example, on Alpari, where my customer is testing.

Previously, even with differences in quotes, there was not such a completely different performance of one EA on different accounts. Now in the visual mode we can see that in one test the position is clearly either positive or negative, but in another test the situation is quite the opposite.

 
You have to look in detail at the discrepancies with all the logs. You can't draw conclusions from a general view, which means you need details.
 
Renat:
You have to look in detail at the discrepancies with all the logs. You can't draw conclusions from a general view. I mean, you need details.
I see. I'll detail it later. Right now, the main thing on the agenda is to get the algorithm right.
 
MT 560, ME 881. Again about the revival of old bugs, already seemingly once closed by you when making updates, described in ServiceDesk.
Reason: