Errors, bugs, questions - page 2793

 
Alexey Viktorov:

I didn't even notice there was a gif... I've looked at it now, but it's so fast, I don't have time to understand it. Just noticed that you don't show the "Swap" column, which is exactly what counts separately in the story. Or explain in words and figures.

Surprised I didn't notice the disabled swaps column myself.

Thank you, issue cleared.

 
Andrey Khatimlianskii:

Surprised I didn't notice the disabled swap column myself.

Thank you, issue cleared.

Hooray¡¡¡¡ we won.

 
When using ChartSetSymbolPeriod the OnDeinit function returns 1 The programme has been removed from the chart, while logically it should return 3 The symbol orperiod of the chart hasbeen changed
 

The bug is that if the if(...) condition is met, nothing should interrupt the loop

if( (vm + vs * (double)i) * tvp * 250.0 < ml ) { cv = vm + vs * (double)i; Print(i,": L/ML - ",cv," / ",ml); };


Here is a video



Here is the full script code

void OnStart()
  {
//---
   
   double tvp  = SymbolInfoDouble(_Symbol,SYMBOL_TRADE_TICK_VALUE_LOSS),
          vm   = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_MIN),
          vs   = SymbolInfoDouble(_Symbol,SYMBOL_VOLUME_STEP),
          ml   = AccountInfoDouble(ACCOUNT_EQUITY) * 0.015,
          cv   = -1.0,
          loss = 0.0;
   
   for(int i = 0; i < 20000; i++)
     {
      Print(i);
      //if( (vm + vs * (double)i) * tvp * 250.0 < ml ) { cv = vm + vs * (double)i; Print(i,": L/ML - ",cv," / ",ml); };
      /*loss = cv * tvp * 250.0;
      Print(NormalizeDouble(loss,2));
      Print(NormalizeDouble(ml,2)); Print(" ");
     */};
   
  }
 
Alexandr Sokolov:

The bug is that if the if(...) condition is met, nothing should interrupt the loop

Your code is similar to this

double a = 3;

for(int i = 0; a > 300; i++)
{
 if(a != 3)
  Print("Никогда такого не будет");
}
 

My indicator has started to lose graphical objects for some reason and does not delete them. I use automatic deletion in class destructor. I call it:

ObjectDelete(chartID, name);

As a result, I get a false positive. I call GetLastError() and get error 4101 ("Errory chart identifier"). Suppose. I compare the chartID of the graphical object being deleted with the ChartID() function result and they are absolutely the same. What can be the reason for not deleting an object from the chart and how can I get around it?

 
Mihail Matkovskij:

My indicator has started to lose graphical objects for some reason and does not delete them. I use automatic deletion in class destructor. I call it:

As a result, I get a false positive. I call GetLastError() and get error 4101 ("Errory chart identifier"). Suppose. I compare the chartID of the graphical object being deleted with the ChartID() function result and they are exactly the same. What can be the reason for not deleting an object from the chart and how can I get around it?

I have similar problems https://www.mql5.com/ru/forum/1111/page2785#comment_17002122

Maybe the creators will do something about it )

Ошибки, баги, вопросы
Ошибки, баги, вопросы
  • 2020.06.22
  • www.mql5.com
Общее обсуждение: Ошибки, баги, вопросы
 

the lack of any feedback here, as if to say, the topic is only needed to vent the negativity of another unpleasant finding )


#include <Arrays\ArrayObj.mqh>

class CPosition:public CObject
{
   public:
      string      meTicket;
      CPosition::CPosition(string inT)
      {this.meTicket = inT;}         
};

class CColl:public CArrayObj
{
public:
   string   meWrongProperty;
CPosition  *operator[](const int index) const { return (CPosition*)At(index);} 
};

class CCollOfColl:public CArrayObj
{
public:
CColl  *operator[](const int index) const { return (CColl*)At(index);} 
};



void OnStart()
{
   CCollOfColl lCOC;
   CColl       *lC;
   
   lC = new CColl();
   lC.Add(new CPosition("00"));
   lC.Add(new CPosition("01"));
   lCOC.Add(lC);
   
   lC = new CColl();
   lC.Add(new CPosition("10"));
   lC.Add(new CPosition("11"));
   
   lCOC.Add(lC);
   
   for(int i=0;i<lCOC.Total();i++)
     {
       for(int j=0;j<lCOC[i].Total();j++)
         {
          printf(lCOC[i][j].meTicket);
          lCOC[i][j].me
         }
     }
}


I think the editor should have suggested meTicket instead of meWrongProperty )

 

Bild 2530

On the third attachment of the structure, no intelligences appear.

//+------------------------------------------------------------------+
//|                                                   TestStruct.mq5 |
//|                        Copyright 2020, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2020, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"

//----------------------------------------------------
struct STRUCT_TIME_IN_FORCE
{
   string GTC; 
   string IOC;  
   string FOK; 
}; 
//----------------------------------------------------
struct STRUCT_SYMBOLS  
{
   string               symbol;                
   STRUCT_TIME_IN_FORCE timeInForce;            
};

//----------------------------------------------------
struct STRUCT_EXCH_INFO  
{
   string         timeZone;      
   long           serverTime;     
   STRUCT_SYMBOLS symbols[];  
};


//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{
   STRUCT_EXCH_INFO Info;
   ArrayResize(Info.symbols, 10);
   
   Info.symbols[0].timeInForce. //??? На третьем вложении не появляется интеллесенс

}
//+------------------------------------------------------------------+
 
Dmytryi Voitukhov:

When checking in the EA marketplace, errors occurred with lot calculation.

There are no errors in the tester.

The code is as simple as it gets. How could there be an error in it?

Read articleWhat tests does a trading robot have to pass before it's published in the Market

Какие проверки должен пройти торговый робот перед публикацией в Маркете
Какие проверки должен пройти торговый робот перед публикацией в Маркете
  • www.mql5.com
Все продукты Маркета перед публикацией проходят обязательную предварительную проверку, так как небольшая ошибка в логике советника или индикатора может привести к убыткам на торговом счете. Именно поэтому нами разработана серия базовых проверок, призванных обеспечить необходимый уровень качества продуктов Маркета. Если в процессе проверки...