Bug in ChartIndicatorDelete()

 

Hi, 

There must be a bug that makes window dialogs fail just after any call to ChartIndicatorDelete()

I am using latest build 1241.

To check it just create a Script with this simple code: 

void OnStart()
{
Print(ChartIndicatorDelete(0, 0, ""));
}

Open a new window for any symbol on any timeframe and run the script. Now press F8 to show Properties or CTRL+B to show objects, it does nothing. 

Same behavior with the context menu. Curiously, opening a New Order from the menu also fails, but F9 works. 

Of course the function call will fail and return false, but if you want to try with an existing indicator name it's just the same.

Changing timeframes, Refreshing data or loading a template does not resolve it.

If you close and reopen MT5, the affected window is not reloaded.

If you close the affected window and reopen it with "Open Deleted", dialogs work again.

Tested on two different machines. 

 

Not reproducible.

Same build, Windows 10 professional.

 
Alain Verleyen:

Not reproducible.

Same build, Windows 10 professional.

Hi Alain,

I checked it again on a brand new Windows virtual machine on Amazon AWS. I can email you the details to login and check it if you want.

 
cesaranui:

Hi Alain,

I checked it again on a brand new Windows virtual machine on Amazon AWS. I can email you the details to login and check it if you want.

I believe you, I am just saying I don't have this problem. Please contact Metaquotes Service Desk.
 
cesaranui:

Hi, 

There must be a bug that makes window dialogs fail just after any call to ChartIndicatorDelete()


I confirm.

Calling ChartIndicatorDelete(), indicator and object lists can not be displayed anymore.

Furthermore, after exit and restart the chart window has been deleted.

Build 1241 on Wine-1.6.1

 

I have this problem too

Metatrader 5 Build 1241 On windows 10 

 

Hi all,

About a month ago I put a request to Service desk, and after a few days they responded that they had fixed it,  so hopefully it will be solved in the next build.

I just would like that important updates like this came more frequently...

In the meantime, what I found is that the problem is with the window, not your EA or the indicators, and the only solution is to replace the window. This can be done automatically using templates: 

void CloneChart()
{
        // Name of the temporary template
        string tpl = MQLInfoString(MQL_PROGRAM_NAME) + "_temp.tpl";

        // Save the actual status of the chart
        ChartSaveTemplate(0, tpl);
        
        // Open a new chart and apply the temporary template
        ChartApplyTemplate(ChartOpen(_Symbol, _Period), tpl);
        
        // Close the bad chart
        ChartClose(0);
}

void OnChartEvent(const int id, const long &lparam, const double &dparam, const string &sparam)
{
        // Key F5 pressed
        if (id == CHARTEVENT_KEYDOWN && lparam == 116)
        {
                CloneChart();
        }
}

 

Of course the next call to ChartIndicatorDelete() will break it again. Then your EA can call CloneChart(), or you can use the keystroke manually.

 

cheers!

César 

 
Thank you cesaranui . Good job

This solution solved my problem

Be Happy My Friend

 

 
Ehsan Tavakoli:
Thank you cesaranui . Good job

This solution solved my problem

Be Happy My Friend

 

glad to know that :)
 

Last build 1274 has resolved the issue with ChartIndicatorDelete() :D

Came yesterday while connected to MetaQuotes-Demo server.

 

Very good :) 

I download setup file & install , but still was 1241 build

How i can download build 1274 without using MetaQuotes-Demo server