Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1004

 

There is a code:

 for (int k=i+1; k<i+barsToProcess; k++){
               if(iCustom(NULL,timeframe,"zz",1,k)>0 && iCustom(NULL,timeframe,"zz",1,k)<(Close[k]*2)){
                  if(ObjectFind(names2[2])>-1)ObjectDelete(names2[2]);
                  ResetLastError();
                 
                  if (ObjectCreate(names2[2],OBJ_TREND,0,iTime(NULL,timeframe,k),iLow(NULL,timeframe,k),iTime(NULL,timeframe,k-1),iLow(NULL,timeframe,k))){
                     ResetLastError(); 
                     if(!ObjectSetInteger(NULL,names2[2],OBJPROP_RAY_RIGHT,true)) PrintFormat("Error SetInteger line 91, err code: %d", GetLastError());
                     value2=iCustom(NULL,timeframe,"zz",1,k);
                     Comment("K ", k);
                     break;
                  }else {PrintFormat("Error when creates trend line at line 93, err code: %d", GetLastError());}
               }
            }

It's supposed to create a trend line. And the code goes in and everything seems fine, but the line is nowhere to be seen on the chart or in the list of objects... And there's the exact same code right in front of it! It also draws a line and everything is OK, it's on the chart. But this code doesn't finish something... probably. What can it be?

 
Yevhenii Levchenko:

There is a code:

It's supposed to create a trend line. And the code goes in and everything seems fine, but the line is nowhere to be seen on the chart or in the list of objects... At the same time, I have exactly the same code right in front of it! It also draws a line and everything is fine, it's on the chart. But this code doesn't finish something... probably. What can it be?

the same name as the first one?

 
Igor Zakharov:

Same name as the first one?

No, different. Is there any way to trace the creation and deletion of the line ?
Tried debugging... I get a hang-up... :(


Added:

All e, solved the problem : )

 
There is no minute candle, Euro dollar on 26/11/19 at 21-58 and immediately at 22-00 with the one at 59 it is not equal to a point, it is exactly absent, the candles are flush without a space.
 
Zlaya_budka:
There is no candlestick in the middle of the day, Euro dollar on 26/11/19 at 21-58 and at once at 22-00, the one at 59 is not equal to a point, it is absent, candlesticks are close without a space.

Metatrader feature, no prices and no data no candle

 
Alexey Viktorov:

Poor Russian language... What can they say without understanding the meaning of the word...

This is clear, but what to do with the fact that many banks simply rob all in a row by requiring verification of the amount and if there was a counterparty struck or something like a foreign exchange difference, then what? And the fact that they require 20% for withdrawal to another bank. somewhere they write a non-declaration and the norm before the tax and the bank will rob just in the way no?

 
 
Zlaya_budka:

This is understandable, but what about the fact that many banks just rob all in a row by asking to confirm the amount and if there was a counterparty struck or something like a foreign exchange difference, then what? And the fact that they require a 20% withdrawal to another bank. somewhere they write a non-declaration and the tax authorities are normal, but the bank will rob just in the way no?

Fight intestinal problems and everything will be fine.

 
What is your problem with the explanation in the documentation?
 
Alexey Viktorov:
Why are you not satisfied with the explanation in the documentation?

It's because there's not a lot of information. I want to understand how the reserve memory works. I also want to understand if the elements are copied to the new space when the size increases. Meaning if I created an array this way?

ArrayResize(массив,10,20);

If I want to make 11 by 20 will the elements be copied to the new space or not? If I make it 10,0 will the elements be copied to the new space or not? Does the backup memory help to solve this problem? Backup memory is just an extra space.

If this extra memory is not one with the array memory, it means that when you resize it, the elements will be copied to the reserve memory and the old space will be deleted.

If this area is one unit and is in operation, no copying will take place until this area is used.


If we take this example

when this array is enlarged, elements will be copied into a new segment; besides, this segment will have to be found anew every time, because there is no reserve.

In the last example we had to find a new section in the caboose and redraw the elements. The question is what the reserve memory is for.

Reason: