Errors, bugs, questions - page 2346

 
Igor Makanu:

and if i have 3-5 instances of a class, how do i wrap this in macro substitution?

make a single wrapper-manager for macro substitution and add classes to the manager. obviously.

 
TheXpert:

make a single wrapper-manager for macro substitution and add classes to the manager. obvious.

can you show me an example of the obvious?

 
Igor Makanu:

an example of the obvious?

You mean write it all down for you?
 
Aleksey Vyazmikin:

From the documentation

The difference between the Bid and Ask prices is called the spread. During testing, the spread is not modelled, but taken from historical data. If the spread is less or equal to zero in the historical data, the last spread known at the time of generation is used.

Since there are no ticks, the spread is the same throughout the entire testing interval, and it is small.

That is all, the issue is closed for now - the closing was not by the take.

Thanks for the willingness to help!

 
Aleksey Vyazmikin:

Since there are no ticks, the spread is the same throughout the testing interval, and it is small.

Take a look at MqlRates.

 
fxsaber:

Take a look at MqlRates.

What am I supposed to see there?

 

Please note the application

Not processed,Started: 2018.12.17 14:19,#2224434

 
Igor Makanu:

Can you show me an example of the obvious?

Would CArrayObj help?

Документация по MQL5: Стандартная библиотека / Коллекции данных / CArrayObj
Документация по MQL5: Стандартная библиотека / Коллекции данных / CArrayObj
  • www.mql5.com
Класс CArrayObj обеспечивает возможность работы с динамическим массивом указателей на экземпляры класса CObject и его наследников. Это дает возможность работы как с многомерными динамическими массивами примитивных типов данных, так и с более сложно организованными структурами данных. В классе реализованы возможности добавления/вставки/удаления...
 
Artyom Trishkin:

Maybe CArrayObj will help?

Thanks Artem, but not there, the problem is that I want to describe MyClass class as typedef and then use macrosubstitutions instandardevent handling functions

as I wrote above, to make a macro substitution in OnInit():

void OnInit( void )
{
  m_class1.OnInit();
  m_class2.OnInit();
  m_class3.OnInit();
.....

for one instance of m_class@fxsaber helped, suggested how to wrap in defines, but for 3... well, so far no luck

 
Igor Makanu:

Thanks Artem, but not there, the problem is that I want to describe MyClass class as typedef and then use macrosubstitutions instandardevent handling functions

as I wrote above, to make a macro substitution in OnInit()

for one instance of m_class@fxsaber helped, suggested how to wrap in defines, but for 3... well, so far no luck

For a single-type class the solution has already been suggested: inherit it from CObject, and add a macro to the class manager which will store all added instances in CArrayObj, loop through it and call the required OnXXX function.

I haven't managed to implement this for different libraries either. To connect several libraries with such macro substitutions in one line, and to call OnTick of all libraries when OnTick is called.

Reason: