Errors, bugs, questions - page 3075

 
Yury Lemeshev #:

I've been suffering for two days now.

From time to time

If(A>B), where A=0.1 and B=0.2 goes into function.

The problem is in the MT5 tester.


Initially, variables were filled from array, now remade from global variables error remains

(if possible) show the full code - do not guess where you have made a mistake :-)

Probably some simple error, such as int B=0.2

 

Code:

 int iGSO1;

   double dGSO1,dGSO2;
   string sGSO1;
   for(iGSO1=0; iGSO1<GlobalVariablesTotal(); iGSO1++)
      {
      sGSO1=GlobalVariableName(iGSO1);
      if(StringFind(sGSO1,"["+MAGICs+"] [GRID#",0)!=-1 && StringFind(sGSO1," BUY ",0)!=-1)
         {
         symbol=StringSubstr(sGSO1,StringFind(sGSO1," BUY ",0)+5);
         if(SymbolInfoDouble(symbol,SYMBOL_BID,dGSO1)==true)
            {
            dGSO2=GlobalVariableGet(sGSO1);
            if(dGSO1<dGSO2 && dGSO1-dGSO2<0)
               {
               iOrderComment=NormalizeDouble(dGSO2,5)+" "+NormalizeDouble(dGSO1,5)+" "+(dGSO1-dGSO2);VO2=0;volumeticket=0.01;intOpenPositionFromGrid();
               ArraySort(iGSA);
               ArrayFill(iGSA,0,1,iGSO1);
               ArrayFill(iGSA,1,1,MAGICs);
               ArrayFill(iGSA,2,1,dGSO2);
               ArrayFill(iGSA,3,1,ticket);GlobalVariableDel(sGSO1);
               }
            }
         }
      if(StringFind(sGSO1,"["+MAGICs+"] [GRID#",0)!=-1 && StringFind(sGSO1," SELL ",0)!=-1)
         {
         symbol=StringSubstr(sGSO1,StringFind(sGSO1," SELL ",0)+6);
         if(SymbolInfoDouble(symbol,SYMBOL_BID,dGSO1)==true)
            {
            dGSO2=GlobalVariableGet(sGSO1);
            if(dGSO1>dGSO2 && dGSO2-dGSO1<0)
               {
               iOrderComment=NormalizeDouble(dGSO2,5)+" "+NormalizeDouble(dGSO1,5)+" "+(dGSO2-dGSO1);VO2=1;volumeticket=0.01;intOpenPositionFromGrid();
               ArraySort(iGSA);
               ArrayFill(iGSA,0,1,iGSO1);
               ArrayFill(iGSA,1,1,MAGICs);
               ArrayFill(iGSA,2,1,dGSO2);
               ArrayFill(iGSA,3,1,ticket);GlobalVariableDel(sGSO1);
               }
            }
         }
      }
 
Unless, of course, it is clear and sufficient.
 
Yury Lemeshev #:
If it is clear and sufficient, of course.

What are the variable names?

 
Yury Lemeshev #:

Code:

dGSO1 is initialised anywhere at all ?

Print the suspects in the log and look at

PrintFormat("these GSO: %f %f",dGSO1,dGSO2);

before the condition...where you check the same thing twice by the way

 

I am working with two or more orders at the same time. Grid. I check the price below or above the conditional entry point. Conditional entry points originally were in the array, now they are in the global ones.

And it turns out that there is a digit swap, but God forbid the swap. If only the comparison was performed correctly. But the substitution also glitches.

symbol="";
         symbol=StringSubstr(sGSO1,StringFind(sGSO1," SELL ",0)+6);
         dGSO1=0;
         if(SymbolInfoDouble(symbol,SYMBOL_BID,dGSO1)==true)
            {
            dGSO2=GlobalVariableGet(sGSO1);
            if(dGSO1>dGSO2 && dGSO2-dGSO1<0)

 
I reset the data before writing new ones, and the symbol itself is written new correctly, but the data on the symbol is taken from another one.
Files:
1mj3v0k1ez.png  24 kb
 
Yury Lemeshev #:

I am working with two or more orders at the same time. Grid. I check the price below or above the conditional entry point. Conditional entry points originally were in the array, now they are in the global ones.

And it turns out that the digits are swapped, but God forbid the swap. If only the comparison was performed correctly. But the switch is glitchy too.

1. What are those variable names? Where do these names come from? It looks like a decompile.

2.Pleasepaste code correctly: when editing a post, click Code and paste your code in the popup window

MQL5.community - Памятка пользователя
MQL5.community - Памятка пользователя
  • www.mql5.com
Вы недавно зарегистрировались и у вас возникли вопросы: Как вставить картинку в сообщение на форуме, как красиво оформить исходный код MQL5, где находятся ваши Личные сообщения? В этой статье мы подготовили для вас несколько практических советов, которые помогут быстрее освоиться на сайте MQL5.community и позволят в полной мере воспользоваться доступными функциональными возможностями.
 
Vladimir Karputov #:

1. What are the variable names? Where did those names come from? It looks like a decompile.

2. Insert the code correctly.

Sorry, I could be misunderstanding you. I didn't understand the first question.

 
Yury Lemeshev #:

I'm sorry, I could be misunderstanding you. I didn't understand the first question.

First question: did you write this code yourself and give these variable names?

Reason: