Errors, bugs, questions - page 1717

 

I'm fine.

 

Hello !

I'm having a strange problem.

I draw a normal TrendLine between the closing points of the two previous bars (on each new bar).

ObjectsDeleteAll(0," ",-1,-1);
ArrayInitialize(cclose,0);
ArrayInitialize(ttime,0);
CopyTime(Symbol(),0,1,2,ttime);
CopyClose(Symbol(),0,1,2,cclose);
price1=cclose[1];
time1=ttime[1];
price2=cclose[0];
time2=ttime[0];

Print("price1=",price1," time1=",time1," price2=",price2," time2=",time2);

//--- создадим трендовую линию по заданным координатам 
   if(!ObjectCreate(chart_ID,nname,OBJ_TREND,sub_window,time1,price1,time2,price2)) 
     { 
      Print(__FUNCTION__, 
            ": не удалось создать линию тренда! Код ошибки = ",GetLastError()); 
      return; 
     } 

Everything is working fine in real time. But in visualization mode in the tester the left point of the line is attached to the origin and doesn't move at all. What is the problem?

Z.U. In MT4 this problem does not seem to arise.

 
fxsaber:

Script

Result

Is it an error? I was expecting to see uchar.

The minimum operation type is int, so all operands of a smaller type are implicitly converted to int type.

Help https://www.mql5.com/ru/docs/basis/types/casting

The char, uchar, short and ushort data types are unconditionally cast to the int type in operations.
Документация по MQL5: Основы языка / Типы данных / Приведение типов
Документация по MQL5: Основы языка / Типы данных / Приведение типов
  • www.mql5.com
Основы языка / Типы данных / Приведение типов - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Alexey Kravchenko:

Hello !

I'm having a strange problem.

I draw a normal TrendLine between the closing points of the two previous bars (on each new bar).

Everything is working fine in real time. But in visualization mode in the tester the left point of the line is attached to the origin and doesn't move at all. What is the problem may anyone know ?
Please give me a minimum working example that can be compiled and run. Also need information about operating system, build and terminal type (after restarting the terminal take the first three lines from the "Log" tab).
 
Ilyas:

The minimum operation type is int, so all operands of a lesser type are implicitly cast to the int type.

Referencing

Thanks. Does it seem correct to perform BATTERY operations without ghosts in C++, like in MQL5?
 
fxsaber:
Thank you. Does it seem right to perform BOTH operations without ghosts in C++, just like in MQL5?
Yes. Exactly the same. In pure C too.
 
Vladislav Andruschenko:

I'm fine.

Thx, I'm going to question the browser.
 
Karputov Vladimir:
Please provide a minimal working example that can be compiled and run. Also need information about operating system, build and terminal type (after restarting the terminal take first three lines from "Log" tab).

There's a problem with the example. The shell bolt itself takes several files. I'll make an easier one when I get home tonight.

WinXP SP3. Build 1434

LE 0 14:55:39.873 Terminal MetaTrader 5 build 1434 started (MetaQuotes Software Corp.)
DI 0 14:55:39.889 Terminal Microsoft Windows XP (X86 based PC), IE 08.00, Intel Pentium Dual E2200 @ 2.20GHz, RAM: 1150 / 2037 Mb, HDD: 74562 / 152625 Mb, GMT+07:00

LJ 0 14:55:39.889 Terminal C:\Program Files\MetaTrader 5

ZY. In any case, okrozme those manipulations that I gave above, nothing else is done. When a new bar is detected, everything is erased and a new line is drawn. But fully example for compilation I will do.

 
Slawa:
Yes. Exactly the same. In pure C, too.
Thank you. Too bad they have historical crutches too.
 
Alexey Kravchenko:

There's a problem with the example. The shell bolt itself takes several files. I'll make an easier one when I get home tonight.

WinXP SP3. Build 1434

LE 0 14:55:39.873 Terminal MetaTrader 5 build 1434 started (MetaQuotes Software Corp.)
DI 0 14:55:39.889 Terminal Microsoft Windows XP (X86 based PC), IE 08.00, Intel Pentium Dual E2200 @ 2.20GHz, RAM: 1150 / 2037 Mb, HDD: 74562 / 152625 Mb, GMT+07:00

LJ 0 14:55:39.889 Terminal C:\Program Files\MetaTrader 5

Z.U. In any case, okromo those manipulations that I gave above, nothing else is done. When a new bar is detected, everything is erased and a new line is drawn. But fully example for compilation I will do.

When we have an example, we will combine everything in one post: problem, example, data of operating system and terminal.
Reason: