Errors, bugs, questions - page 763

 
x100intraday:

...If magnitude points are bound to extrema (special cases) or to chart coordinates in general - price/time, then what is "Scale" bound to, I wonder? If there are some exact values of scale being dumped into the template when writing... or pips per bar, it doesn't allow restoring the original outline in a new session. Only the exact coordinates of the first point are retained. Roughly speaking, patterns based on anchoring points to explicit and simple coordinates are more reliable.

1st point is price and time, 2nd point is time, price is calculated considering the scale in n/b.

I don't know what is written in the template, I think it should have all 4 values: 2 times, price of the first point, scale.

Then there may be problems if there are missing bars, I guess.

 
Silent:

It's not a removal problem, it's a creation problem :)

I had a script with the wrong loop do the same thing. Printed the loop, even after forcibly deleting the script via"Expert List", until it popped up with an error.

Not sure why the creation error?

I create without loop, I don't need it for 3 objects.

I just do it for each one:

if(ObjectFind(0,_name)!=0)//если не нашли создаем
     {
      ObjectCreate(0,_name,OBJ_RECTANGLE,0,_begin_time,_open,_end_time,_close);
         ObjectSetInteger(0,_name,OBJPROP_STYLE,STYLE_SOLID);
         ObjectSetInteger(0,_name,OBJPROP_WIDTH,Width);
         ObjectSetInteger(0,_name,OBJPROP_BACK,_Top);
         ObjectSetInteger(0,_name,OBJPROP_FILL,_BG);
         ObjectSetInteger(0,_name,OBJPROP_SELECTED,false);
         ObjectSetInteger(0,_name,OBJPROP_COLOR,_Color);
     }
else //если нашли модифицируем
     {
      ObjectMove(0,_name,0,_begin_time,_open);
      ObjectMove(0,_name,1,_end_time,_close);
      ObjectSetInteger(0,_name,OBJPROP_COLOR,_Color);
     }

In general, the first clues are appearing, but it's too early to tell.

 

Do you check that the object was created in the code?

Документация по MQL5: Основы языка / Операторы / Оператор создания объекта new
Документация по MQL5: Основы языка / Операторы / Оператор создания объекта new
  • www.mql5.com
Основы языка / Операторы / Оператор создания объекта new - Документация по MQL5
 
kPVT:

I don't understand why the creation error?

...

Because.
kPVT:

...

Objects are deleted, but re-created and continue to "wiggle" as if the indicator is still running.

If deleted manually, they are created again with the same name and keep "moving" as new ticks come in.

...

The indicator searches them with every tick and either creates or modifies, as I understand it.

Maybe: if already present and modified - nothing to do (block)?

 
alexvd:

Do you check the fact that the object was created in the code?

Silent:
Maybe: if already there is and modified - nothing to do (block) is missing?

The reason is the following.

If you get the indicator handle #1 from the indicator #2, it doesn't complete deinit of the indicator #1, until you delete the indicator #2.

If there are buffer constructions, they are removed, but the graphical objects remain.

Here are two indicators for testing.

1. We attach test_del_obj, then test_id.

2. We remove test_del_obj - the cube from test_del_obj remains.

3. Remove test_id - the cube is removed and we see in the log that only now deinit of test_del_obj indicator is executed.

Files:
 

Another question.

Is the indicator handle attached to the chart unique?

If you change the test_id indicator by adding a timed polling of the test_del_obj indicator handle, you can see that the value increases by 1 for each request.

Files:
 

ArrayResize() does not work correctly

When decreasing the size of a dynamic array, ArrayResize() trims elements from the wrong side of the array.

Code:

   double Arr[];
   ArrayResize(Arr,5);
   Arr[0]=101;
   Arr[1]=102;
   Arr[2]=103;
   Arr[3]=104;
   Arr[4]=105;   
   Print("Начальный массив: ",Arr[0],":",Arr[1],":",Arr[2],":",Arr[3],":",Arr[4]);
   ArraySetAsSeries(Arr,true);
   ArrayResize(Arr,4);
   Print("Обрезанный массив: ",Arr[0],":",Arr[1],":",Arr[2],":",Arr[3]);

Result:

2012.07.04 21:28:53     Ind2 (EURUSD,H4)        Обрезанный массив: 104.0:103.0:102.0:101.0
2012.07.04 21:28:53     Ind2 (EURUSD,H4)        Начальный массив: 101.0:102.0:103.0:104.0:105.0

Same code and result in MetaTrader 4:

2012.07.04 21:28:35     ind2 EURUSD,H4: Обрезанный массив: 105:104:103:102
2012.07.04 21:28:35     ind2 EURUSD,H4: Начальный массив: 101:102:103:104:105
Files:
Ind2.mq5  2 kb
 

Dear MT5 developers. I draw your attention - the most important thing for a Forex server is correctness of quotes. Therefore, investigate incorrectness in your MT5 (MetaQuotes-Demo server):

1) Changing the volume in the previously loaded candlesticks - for example, today at 8:00 EURUSD H4, the values were 0:00 - 6171, 4:00 - 7049, 8:00 - 13361. And when loading at 20:00 (on Europe), the values were 0:00 - 7701, 4:00 - 8859, 8:00 - 16306. In general it will not be difficult for you to see that the volume is going on in Russian speaking screwed up. Since I have the honor to speak not only on my behalf, but also at the request of comrades, I say - it is very frustrating for those who use the model with volume and with its accumulation.

2) Let's put Alpari MT4 on the left and Metaquotes MT5 on the right and be amazed that the minutes on Metaquotes are closing much earlier than on Alpari. We check with time.windows.com and the clock on our hand - the time of the metaquotes server is running ahead! - Pips traders are complaining here - there is a significant random source in trading.

3) A generally outrageous wish - can we make bid and ask available for both saving and viewing, separately and/or jointly. I've been asked, but I realise that's not realistic. As far as I understand in MT3 in general there was something between bid and ask, and it probably lies in the history. Now only bid.

 
MoneyJinn:

ArrayResize() does not work correctly

That's right. AsSeries is just a flag.
 
TheXpert:
Everything is correct. AsSeries is just a flag.

See behavior of array elements influenced byArraySetAsSeries(Arr,true) and how it works in 4.

I would like to add. that at the end of 2011 everything worked correctly, because I wrote code on this topic, which now no longer works.

Reason: