Errors, bugs, questions - page 171

 
Rosh:
This shouldn't be the case. Need source code, better write to Service Desk.

I will try to figure out Service Desk , but unequivocally my class is written correctly, because if I declare one pointer to a class - all ok, two or more errors due to incorrect memory allocation, I create a variable of class type, all ok, I create 10 variables of class type - all ok too, because I do not use the new operator

By and large, it's not hard to allocate memory when calling the constructor, but alas, I can't pass at least one parameter to the constructor

 
Lizar:

I add the indicator to the chart with ChartIndicatorAdd() function. Now I can't figure out which function to remove it from the chart.

There is no such possibility.

And IndicatorRelease will not help you here.

 
IgorM:


By and large it is not difficult to allocate memory when the constructor is called, but alas, I cannot pass at least one parameter to the constructor

Create a special function for initialization, which does everything you would like to see in a traditional constructor. And call it right after declaration (for automatically created objects) or call new operator (for dynamically created objects).
Документация по MQL5: Основы языка / Операторы / Оператор создания объекта new
Документация по MQL5: Основы языка / Операторы / Оператор создания объекта new
  • www.mql5.com
Основы языка / Операторы / Оператор создания объекта new - Документация по MQL5
 
Rosh:
Create a special function for initialization, that does everything you would like to see in a traditional constructor. And call it right after declaration (for automatically created objects) or call new operator (for dynamically created objects).

I did that a long time ago, but it would be better to do it all in the constructor - it would allow to allocate memory using ArrayResize() and guarantee the correct memory allocation when working with pointers

ok, no way to pass the parameter for memory allocation to the constructor, I've coped with that, too bad you can't promise me that

SZY: I haven't found operator overloading in MQL5, in C++ it's void operator +(); http://www.programmersclub.ru/24/ - trifle, but I used it back in 1995 in Borland C++

 
IgorM:

HH: I couldn't find operator overloading in MQL5, in C++ it's void operator +(); http://www.programmersclub.ru/24/ - trifle, and I used it back in 1995 in Borland C++

There is no such thing as overloading:

Overloading

Two or more methods can be defined within the same class that share the same name but have different numbers of parameters. When this occurs, methods are called overloaded, and the process is referred to as method overloading. Method overloading is one of the ways in which polymorphism is implemented. Method overloading in classes follows the same rules as function overloading.

If there is no exact match for the function to be called, the compiler searches three levels sequentially

  1. searching among the methods of the class;
  2. Searching among the methods of the base classes, starting from the closest ancestor up to the first one;
  3. Searching among the remaining functions.

If no exact match is found at any level, but several suitable functions at different levels are found, the function found at the lowest level is used. There cannot be more than one suitable function within one level.

There is no operator overloading in MQL5.

 

Does anyone have any solutions for "restoring" balance lines and equity from historical data?

Really need such a fic....

PS

I actually have some ideas about the balance but I have only questions about equity. :(

 
Interesting:

Does anyone have any solutions for "restoring" balance lines and equity from historical data?

Really need such a fic....

PS

I actually have some ideas about balance but I have only questions about equity. :(


You can try to export the list of trades and write an Expert Advisor, which will repeat the actions and run it in the tester)
 
mrProF:
You can try to export the list of trades and write an Expert Advisor that will repeat the action and run it in the tester)

That's not it. You need inside the EA and only based on historical data.

The balance line can be restored simply based on the history of trades, there is almost no question about it.

We create a list of trades that affect the balance and build a balance curve based on them.

The complexity lies in building the equity curve. This requires us to calculate which trades were opened and what happened to the open positions and how they affected equity.

All this should be done in certain time intervals (say, at the moment of forming a new daily or 00:00 server time).

PS

The matter is to restore (build) balance and equity lines inside the Expert Advisor attached to a real or demo account (where the trades were held earlier).

At the same time, the Expert Advisor will not be able to load this data from a file.

 
Interesting:

That's not it. You need inside the EA and only on historical data.

Look in the mql4.com database for the equity indicator.

The math will remain the same, you only need to change the trade accounting.

 
komposter:

Look in the mql4.com database for the equity indicator.

The math will remain the same, you will only need to change the trade accounting.

Thank you, I will take a look at it.