Errors, bugs, questions - page 819

 
abeiks:

Afternoon.

I've created a block to count beats on envelopes lines, it seems to count everything correctly, but there are some entries missing in the log - for example there is count[Number] =3 and the next count[Number] =5. I can see that the counting is correct but the log is missing for some reasoncount [Number] =4. Sometimes the log has all the entries. I don't understand why it happens. If you see errors in the code, can you correct the code?

Are there exactly no records in log? Or only in "Experts" tab? I am inclined to the second one, because when outputting to the tab at high speed, some lines are skipped. This is a bug, not a bug, because this output is less slow down the program. But in the log is printed all the lines, there are no skips.

Check it. If you see gaps in the log, in that case, contact Service Desk.

Also, sometimes running the tester throws an error " OnTick critical error " but the next time it starts, it starts testing. What could be the problem?

This is up to developers.
 
MetaDriver:

Are there no entries in the log, or only in the "Experts" tab? I am inclined to the second one, because when outputting to the tab at high speed, some lines are skipped. This is a feature, not a bug, because this output is less slowing down the program. But all lines are output to the log, there are no skips there.

Check it. If you see gaps in the log, in that case, contact Service Desk.

This is up to developers.

Yes, you are right, it turns out everything is in the log. When visually testing, I was watching the logs, so I didn't notice it. Wasn't aware of this feature. Thank you!

Визуализируй стратегию в тестере MetaTrader 5
Визуализируй стратегию в тестере MetaTrader 5
  • 2012.06.08
  • MetaQuotes Software Corp.
  • www.mql5.com
Каждому из нас давно знакома поговорка "Лучше один раз увидеть, чем сто раз услышать". Вы можете прочитать десятки книг о Париже или Венеции, но мысленные образы не позволят вам испытать те же ощущения, как от прогулки по их вечерним улицам. Преимущество визуализации, или наглядного представления, может быть легко спроецировано на любой аспект нашей жизни, включая и работу на рынке, например, анализ цен на графиках при помощи индикаторов, и конечно же, визуализация тестирования стратегий. В данной статье собраны все возможности тестера стратегий MetaTrader 5 по визуализации вычислений.
 
abeiks:

Yes, you're right, it turns out it's all there in the log. Was keeping an eye on the log during visual testing, so didn't notice. Wasn't aware of such a feature. Thank you!

OK.

--

To select text as a quote, just mark it and press Ctrl+3; or when replying, use the reply link in the bottom right corner of the post

 
Good evening! I can't open a warrant. I have tried to write everything according to the explanations and help. I would like to understand what is wrong in this example!
//+------------------------------------------------------------------+
//|                                                     ордерній.mq5 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

   MqlTick last_tick;
SymbolInfoTick(_Symbol,last_tick);
double Ask=last_tick.ask;
double Bid=last_tick.bid;

   MqlTradeRequest request={0};
   MqlTradeResult result={0};
   
   request.action= TRADE_ACTION_DEAL;
   request.magic =600;
   request.symbol=Symbol();
   request.volume=1;
   request.sl=Bid-300*Point();
   request.tp=Bid+300*Point();
   request.type=ORDER_TYPE_BUY;
   OrderSend( request,   result    );    
        
  int Error=GetLastError( ) ; ResetLastError();
  printf("Error ",Error);

   
  }
//+------------------------------------------------------------------+
 
MetaDriver:

... To select text as a quote, just mark it and press Ctrl+3 ...

Thank you, I didn't realise it was that easy.
 
Dimka-novitsek:
Good evening, I cannot open an order. I have tried to write everything as explained in the article. I would like to find out what is wrong in this example!

Try this

//+------------------------------------------------------------------+
//|                                                     ордерній.mq5 |
//|                        Copyright 2012, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2012, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   return(0);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//---
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---

   MqlTick last_tick;
SymbolInfoTick(_Symbol,last_tick);
double Ask=last_tick.ask;
double Bid=last_tick.bid;

   MqlTradeRequest request={0};
   MqlTradeResult result={0};
   
   request.action= TRADE_ACTION_DEAL;
   request.magic =600;
   request.symbol=Symbol();
   request.price=Bid;
   request.deviation=20;
   request.volume=1;
   request.sl=Bid-300*Point();
   request.tp=Bid+300*Point();
   request.type=ORDER_TYPE_BUY;
   OrderSend( request,   result    );    
        
  int Error=GetLastError( ) ; ResetLastError();
  printf("Error %i",Error);

   
  }
//+------------------------------------------------------------------+

You are missing the opening price and slippage.

request.price=Bid;
request.deviation=20;

You can also read Structure of trade request(MqlTradeRequest)

 

Thank you!!! I'll give it a try. The main thing is to read, the main thing is to figure it out!!!

I actually thought it was so natural to buy at the existing price that it didn't have to be specified.

What's the mode if I just open a pose?

 
No. In the messages it only writes Error and resultat, it doesn't write the values of these variables! This is the place.
       
  int Error=GetLastError( ) ; ResetLastError();
  printf("Error ",Error);
  
  uint resultat= result.retcode ;
   printf("resultat ",resultat);
   
 
Dimka-novitsek:
No. In the messages he writes only the Error and resultat, he does not write the values of these variables! This is the place.

And I gave you this code

int Error=GetLastError( ) ; ResetLastError();
printf("Error %i",Error);

Do result.retcode by analogy.

 
fyords:

And I gave you this code

Do the same for result.retcode.

Apologies! I thought the machine didn't read the quoted text at all, and that icon was an insignificant oversight.