Errors, bugs, questions - page 3006

 
Aliaksandr Hryshyn:
There the pointer copies
How do you copy data? Well, other than element by element?
 
Vasiliy Pushkaryov:
And how can you copy data? Well, apart from element by element?

I don't know if this is right, but the additional constructor solved the problem. It may be useful to someone.

#include <Arrays\ArrayObj.mqh>

CArrayObj ArrCur;       // массив с объектами, каждый объект содержит структуру с полями ордеров и его id
CArrayObj ArrPrev;  // массив с объектами, каждый объект содержит структуру с полями ордеров и его id

class CID : public CObject
{
  public:  int id;
           CID() {}
           CID(CID* pt) {this = pt;}
           
};


void OnStart()
{
  // -----------------------------------------------------------------
    CID* pCur = new CID;          // создаем объект для текущих параметров
    pCur.id = 25;                 // вносим текущие данные
    ArrCur.Add(pCur);             // помещаем в массив объектов
    
    CID* pTemp = ArrCur.At(0);    // вытягиваем объект по указателю
    CID* pPrev = new CID(pTemp);  // в дин.объект копируем в конструкторе данные с предыд.указателя
    ArrPrev.Add(pPrev);           // помещаем в массив объектов
    
    ArrCur.Clear();               // чистим текущий массив
  // -----------------------------------------------------------------
  
   // --- для вывода в журнал
  int sizeCur = ArrCur.Total();       // размер = 0
  int sizePrev = ArrPrev.Total();     // размер = 1
  
  ENUM_POINTER_TYPE pTypeCur = CheckPointer(ArrCur.At(0));    // POINTER_INVALID
  ENUM_POINTER_TYPE pTypePrev = CheckPointer(ArrPrev.At(0));  // POINTER_DINAMYC
  
  Print(__FUNCTION__, " sizeCur=", sizeCur, " pTypeCur=", EnumToString(pTypeCur));
  Print(__FUNCTION__, " sizePrev=", sizePrev, " pTypePrev=", EnumToString(pTypePrev));

  ArrPrev.Clear();             // чистим массив
}
 
fxsaber:

ChartScreenShot does not work correctly in visual tester mode.

void OnTick()
{
  Print(ChartScreenShot(0, "Test.png", 100, 100)); // true, но файл нулевой длины
  
  ExpertRemove();
}

Hello, dear developers. May I ask when ChartScreenShot() will work in the tester?

 

Can you tell me how to change input parameters (F7) or change value of global variable (F3) in this kind of EA?

input int i = 0;

const bool Init = EventSetTimer(1);

void OnTimer()
{
  Alert("");
}

Even taking it off the chart is problematic.

 
Good evening I have such a question? Installed agent manager for sale but the cloud column says disabled and all day on six processors not a single movement. In the account the processors are displayed. Is this normal?
 

Previously, Debug was not fully usable, but running scripts with F5 is sometimes handy (although it's not clear why it runs on a new chart and not on the current one).

And I accidentally found such records in the log:

At the same time, the script itself is running. I tried to insert the following line into the code:

{ DebugBreak(); Print( "DebugBreak" ); }

The "DebugBreak" line is printed but it is not stopped.

 
A100:

(although it's not clear why it runs on the new chart and not on the current one).

In the editor Service->Settings->Debugging/Profiling
you can set which symbol will be used for debugging, but it will still run on a separate chart.
If no symbol is specified there, it will run on the very first (top) symbol from Market Watch.

I have breakpoints in general that are triggered every once in a while. I am building 2875
, set the points, click to start debugging on real data, and it blips through without stopping, having finished debugging.
I restart the terminal with the editor, and then it starts seeing breakpoints, until some other start/stop debugging, then it starts skipping again.
Running debugging on historical data, it calls a tester window at all, and skips breakpoints just as it finishes debugging.
It has never stopped at a breakpoint on historical data, it skips all the timecompleting debugging.
But
why the tester is called on historical data and the saved parameters are taken from it, I don't know what it is, is it designed that way or is it a crookedness.

 
Roman:

In the editor Service->Settings->Debugging/Profiling
you can set which symbol will be used for debugging, but it will still run on a separate chart.
If the symbol is not specified there, it will run on the very first (top) symbol from Market Watch.

To my mind this is extremely inconvenient. The current chart has indicators, graphical objects with which the program is supposed to interact, settings, etc. A new "empty" chart is started. In addition, the program in the normal mode (not debugging) is launched from the Navigator on the current chart, not on the new one - this is an obvious inconsistency

 
The visualisation is also a bit confusing
https://www.mql5.com/ru/forum/368597
Ошибка моделирования визуализация\без
Ошибка моделирования визуализация\без
  • 2021.05.04
  • www.mql5.com
Кто нибудь может объяснить как это происходит , или протестировать у себя...
 
Execution error (incorrect substitution order)
#define  MACRO( X )
void OnStart()
{
        MACRO( __COUNTER__ )
        MACRO( __COUNTER__ )
        Print( __COUNTER__ );
}

Result: 2

Expected result: 0

Reason: