Errors, bugs, questions - page 2184

 

It transfers to mt4 without any problems.

How do I transfer an array to mt5?

void OnTick()
 {
  int m[][2];
  Array(m);

  int k[][3];
  Array(k); // 'k' - parameter conversion not allowed
 }

template<typename T>
void Array(T& arr[][2]) { }
 
Vitaly Muzichenko

How do you pass an array in mt5?

In C++ it would look something like this

template<typename T, int n>
void Array(T arr[][n]) {}
 

Error during execution

struct A {
        A() : i( 1 ) {}
        int i;
};
struct B : A {};
void OnStart()
{
        B b;
        Print( b.i );
}

Result: 0

Expected: 1

 
A100:

In C++ it would look something like this:

But in mql5 how?

 
Vitaly Muzichenko:

How about in mql5?

There is no such mechanism

 

Misunderstood .

struct String {};
String f1() { String s; return s; }
string f2() { string s; return s; }
void   g1( String& ) {}
void   g2( string& ) {}
void OnStart()
{
        g1(f1()); //нормально
        g2(f2()); //Error: 'f2' - parameter passed as reference, variable expected
}

In the first case it's fine, in the second it's a compilation error. What's the difference?

 

The keywords do not work correctly in the preprocessor

//#define struct class 
struct A {
#ifdef struct
public:
        void f( A* ) {} //Error ???
#else
        void f( A& ) {}
#endif
};
//#define string String 
void OnStart()
{
#ifdef string
        Print( 1 );
#else
        Print( 2 );
#endif
}

Result: 1

Expected: 2

 
Vladimir Karputov:

They are aware of this error and are fixing it. I myself am waiting.

It's taking a long time to fix https://www.mql5.com/ru/forum/216476/page7#comment_5834235

There it was.

#include <Controls\WndContainer.mqh>
class Rect {};

Here

#include <Trade/Trade.mqh>
class Entry {};
and the application itself #1660355 was in fact already more than a year ago https://www.mql5.com/ru/forum/1111/page1797#comment_4042334
Предложение для удобства использования MetaEditor
Предложение для удобства использования MetaEditor
  • 2017.09.29
  • www.mql5.com
Здравствуйте. Хотел бы предложить разработчикам сделать в MetaEditor стандартизировать отступы при написание кода, как это сделано в VisualStudio...
 

I suggest that OnTesterInit should allow the main test symbol to be specified

enum ENUM_TESTER_INFO_STRING
{
  TESTER_SYMBOL;
};

string TesterInfoString( const ENUM_TESTER_INFO_STRING property_id );
bool TesterSetString( const ENUM_TESTER_INFO_STRING property_id, const string property_value );

void OnTesterInit()
{
  TesterSetString(TESTER_SYMBOL, "EURUSD");
}
 

Все символы, выбранные в окне "Обзор рынка"

Unlike the previous two, this optimization mode allows you to test the EA with the sameinput parameters, but on different symbols. In each optimization pass, onlythe main symbol of the EAtest is changed, in other words, the chart symbol to which the EA would be attached.

Optimization is performed only on those symbols which are currently selected in the"Market Watch" window. This way you can manage the optimization by adjusting the set of selected symbols.

  • Please note that downloading the required price data from the server can take a long time. However, the slowdown of the optimization process as a result of data downloading occurs only when it is launched for the first time on a symbol, subsequently only the missing data are downloaded.
  • The current valuesof the input parameters specified in the "Value" column are used during symbol optimisation.


It is very much missing Optimization mode, when there is a sequential enumeration of symbols from Market Watch and in each of them there is Optimization of input parameters.

This mode is very useful when looking for the appropriate symbol for TS. And it is especially relevant when custom symbols exist - you create different custom symbols and look at their properties in the Optimizer.

Оптимизация стратегий - Алгоритмический трейдинг, торговые роботы - MetaTrader 5
Оптимизация стратегий - Алгоритмический трейдинг, торговые роботы - MetaTrader 5
  • www.metatrader5.com
Тестер стратегий позволяет тестировать и оптимизировать торговые стратегии (советники) перед началом использования их в реальной торговле. При тестировании советника происходит его однократная прогонка с начальными параметрами на исторических данных. При оптимизации торговая стратегия прогоняется несколько раз с различным набором параметров...