Errors, bugs, questions - page 1638

 
Dmitry Voronkov:
Good day.
Please advise MQL4 and MQL5 why they have the function of removing an indicator subwindow from an Expert Advisor but they don't have the function of creating an indicator window.
I have to use templates or start the window indicator manually, which is not convenient because the information on the chart gets lost.
I would also like to be able to start and display indicators from a resource file.
Or advise how to do it.

The ChartIndicatorAdd function can be used to create a sub-window

About indicators from resources is written here https://www.mql5.com/ru/docs/runtime/resources in the very end - "Work with custom indicators connected as resources".

Документация по MQL5: Программы MQL5 / Ресурсы
Документация по MQL5: Программы MQL5 / Ресурсы
  • www.mql5.com
Программы MQL5 / Ресурсы - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Slawa:

The ChartIndicatorAdd function can be used to create a sub-window

About indicators from resources is written here https://www.mql5.com/ru/docs/runtime/resources at the very end - "Working with custom indicators connected as resources".

Thanks for the help.

I have not got this function in 4 unfortunately. Too bad :)

 
kofesutra:

Mt5 tester's bug: OHLC does not match in the tester and in MT5 itself, moreover, High and Low are inside the Open/Close range :(

This candlestick, unfortunately, is not the only one. What to do? Advise how to write to the developers, guys!

2016.08.13 12:38:48.956 Terminal C:\Program Files\Alpari Limited MT5
2016.08.13 12:38:48.956 Terminal Microsoft Windows XP (x64 based PC) on Wine, IE 08.00, Intel Pentium 4 2.40GHz, RAM: 6131 / 7688 Mb, HDD: 33959 / 159136 Mb, GMT+02:00
2016.08.13 12:38:48.955 Terminal Alpari Limited MT5 x64 build 1375 started (Alpari Limited)

I ran the tester again and saw a trick: High is redrawing O_o as the candle is forming. At some point it changes value to a lower one, falls into Open/Close range and then changes its value within that range.

OHLC on M1


It has been found and corrected. Thanks for the message.

While there is no fixed build, this bug can be bypassed by testing on daily ( rather than weekly) timeframe. In this case, all the weeks are formed correctly

 
Ilyas:

Remove the inverted commas from the body of the macro

To convert a macro parameter to a string use #:

## is used to glue the tokens together
Thank you!
 
Slawa:

Found and corrected. Thanks for the message.

While there is no fixed build, this bug can be bypassed by testing on a daily ( rather than weekly) timeframe. In this case, all the weeks are formed correctly

Thank you! Roger that and I will wait for the corrected build.
 
On what days of the week is the kodobase updated?
 

Ambiguity:

class A {};
class B {
        virtual B *f() { return NULL; }
        virtual A *g() { return NULL; }
};
class C : public B {
        virtual C *f() { return NULL; } //нормально
        virtual C *g() { return NULL; } //Error: overriding virtual function with different return type
};

In one case you can overload a method with a different return type, but in another case you cannot

 

Error during execution

//Script3.mq5
class A {};
class B : public A {
public:
        B( int ii ) : i( ii ) {}
        void f( A *a ) { i = g( a ); }
        int g(  A& a ) { return ((B *)&a).i; }
        int i;
};
void OnStart()
{
        B a = 1,
          b = 2;
        a.f( &b );
        Print( "OK:", a.i );
}

Result:

2016.08.16 10:22:45.244 Script3 (GBPUSD,M15) invalid pointer access in 'Script3.mq5' (11,27)

This error is floating. Doesn't occur if you rewrite the same thing in another way

 
A100:

Error during execution

Result:

2016.08.16 10:22:45.244 Script3 (GBPUSD,M15) invalid pointer access in 'Script3.mq5' (11,27)

This error is floating. Doesn't occur if you rewrite the same thing in another way

Thank you, it's fixed.
 
A100:

Ambiguity:

In one case you can overload a method with a different return type, but in another case you cannot

We did this deliberately because there are no problems with direct inheritance.
Reason: