Questions from Beginners MQL5 MT5 MetaTrader 5 - page 385

 
Artyom Trishkin:

Yeah, thanks for the science. I'll be sure to think about it...

ZS. What prevents then to return the check not in a condition, but in a variable and already check it? Probably the wildest complexity of this project in the future...

And one more thing: if the project is being expanded, the code execution time may increase too. As a result, there will be a lot of calculations to be performed after the data is written into the variable. So, isn't it possible that by the time we need a second check, the order will have already been closed (at a stop, for example ... or a take ...), and the program will then calculate an incorrect value stored in the variable?

Exactly - we must think in advance about large projects and all the possible situations that may occur. So I stand by my conviction - always have the latest data just before you use it. As much as possible.

I will add on the highlighted and after use, if new trading conditions follow
 
Artyom Trishkin:
Are you talking to me? Well, good for you too. But in the end you will go back to what I suggested, thereby joining the ranks of inadequates.
I also wanted to write him something, but the man writes with grammatical errors, so I thought - no need, it's too late, he won't understand....
 
new-rena:
I will add on the highlighted and after use, if new trading conditions follow

Well, if the data is still needed afterwards, it must be fresh again. I.e., find them again in the market - not read from a variable, but find them. Then, even switching off the terminal will not affect the values of the variables. They have started - obtained fresh information, thereby found out the general state of the environment at the moment of startup and continued working from the point where they were before. Naturally, we have made some adjustments for the new realities after restarting the terminal. But our data is the most up-to-date at the current moment. And variables ... ...are definitely not for storing important information. But for using in trading orders, or for making important decisions - first, all the necessary data was read from the server into the variables, then it was analyzed, a decision was made based on the analysis of fresh data, and the values of the variables were passed to the function responsible for the specific actions to be taken by the Expert Advisor when making a decision. Something like this ...

Well ... I'm not talking about the tester, if anything ...

 
new-rena:
I also wanted to write him something, but the man writes with grammatical errors, so I thought - no need, it's too late, he won't understand....
:) Late - in the sense of "lost forever"? Or just - bye time for him?
 
Artyom Trishkin:
:) Late - as in "lost forever"? Or just - bye-bye time for him?

the first one, judging by what he writes to people who give him advice.

Bye - there are three meanings here )

 
new-rena:

one, judging by what he writes to people who give him advice.

Bye - there are three meanings here.)

Well... I don't think he's going to buy anything. So that leaves us either to sleep or to say goodbye...
 
Artyom Trishkin:
Well... ...I don't think he's going to buy anything. So it's either sleep or goodbye...
let's see - beginner's luck )
 
new-rena:
let's see - beginner's luck)
I've heard a different saying ...
 
Please advise me. I am connected to a signal and accordingly I have its open orders copied, can I change the volume of the lot it trades in any way. If so, how?
 

Look, on the four, I can't seem to get through...

I work with arrays - I need to write the tick arrival time in the array - for example, I write a bid. On every tick. I do everything according to tickets, for which I am grateful to Artyom Trishkin . Not everything works. Fought for the second day. Prints

 Print (" Значение xBuffer_Time[SIZE-1] = ", DoubleToStr(xBuffer_Time[SIZE-1],Digits) );

zeros.

https://www.mql5.com/ru/forum/145455/page913#1017464

//---------------------
extern int MaxDrawTicks=100;
extern int Num_Aver_of_Ticks=5;  
double     xBuffer_Time []; // Массив значений  
                         // В котором индекс - номер тика, значение - это бид 
int SIZE=0;               // Вспомогательная переменная для массива                                  
int tickCounter, tickCounter_Current; 
//+------------------------------------------------------------------+
int init()
  {   
//--- устанавливаем размер динамического массива
   if(ArrayResize(xBuffer_Time,SIZE)<0) {Print(" Ошибка в изменении размера массива времени поступления тиков "); return(false);}
//--- установим индексацию для буфера как в таймсерии для динамического массива
  // ArraySetAsSeries(xBuffer_Time,true);    
//---   Возвращает количество элементов указанного массива. 
   SIZE=ArraySize(xBuffer_Time);
   if (SIZE>=0) Print("Размер массива: ",SIZE);
   else Print("Ошибка. Массив не создан ",SIZE);        
   ArrayInitialize(xBuffer_Time, 0);
   return(0);
  }  
//+------------------------------------------------------------------+
int start()
  {  
   //ArrayResize(ValueArr,size);
   //ValueArr[size-1] = GetValue();
   //size++; 
 //----------------------------------------  
   ArrayResize(xBuffer_Time,SIZE);
   xBuffer_Time[SIZE-1] = Bid; //NormalizeDouble((iTime (_Symbol,1,0)-_start), 2); 
   SIZE ++;
   Print (" Значение xBuffer_Time[SIZE-1] = ", DoubleToStr(xBuffer_Time[SIZE-1],Digits) );
   Print (" Значение SIZE = ", DoubleToStr(SIZE,2) );  
 //---------------------------------------      
//------------
   return(0);
  }

Thank you.

Любой вопрос новичка, чтоб не захламлять форум. Профи, не проходите мимо. Без вас никуда - 6. - MQL4 форум
  • www.mql5.com
Любой вопрос новичка, чтоб не захламлять форум. Профи, не проходите мимо. Без вас никуда - 6. - MQL4 форум