Errors, bugs, questions - page 2741

 
Ilyas:

The debugger in MT4 will not change.

We are completely redesigning debugging and profiling system of MQL-code. New system is not compatible with MT4

MT4 BILD 1262 Terminal crashes


2020.05.13 18:05:09.335 Access violation write to 0x0335346E

2020.05.13 18:05:09.276 VR EURUSD,H4: 1 leaked strings left

2020.05.13 18:11:11.126 Access violation write to 0x033403B7

2020.05.13 18:37:13.585 Access violation write to 0x03093648


Can you say something about it? I made a mini source code reproducing the problem

 
Vladimir Pastushak:

MT 4 BILD 1262 Terminal crashes


2020.05.13 18:05:09.335 Access violation write to 0x0335346E

2020.05.13 18:05:09.276 VR EURUSD,H4: 1 leaked strings left

2020.05.13 18:11:11.126 Access violation write to 0x033403B7

2020.05.13 18:37:13.585 Access violation write to 0x03093648


Can you say something about it? I made a mini source code to reproduce the problem.

Send me the source code via private message and I will check it.

 
Ilyas:

The debugger in MT4 will not change.

We are completely redesigning the debugging and profiling system of MQL code, the new system is not compatible with MT4

Cool. You can forget about developing serious indicators for MT4.

Thank you, we will know.

 
Andrey Khatimlianskii:

Indicators in the interface stream, until they are counted, the terminal does not draw anything. That's why it hangs up.

Four will not be corrected, most likely.

In five similar indicators work, but all is normal, without freezes.

 
MT5 (build 2419) was working with debugger, went to browser for a couple of minutes, then went back to MT and it was completely empty for some reason:
- no windows, no panels, no tools, no nothing...

 
MT5, how do I programmatically disable price scaling via Ctrl + Mouse Wheel?
I make a panel, programmatically catch Ctrl + Mouse Wheel and scale panel elements.
However, the same event triggers price scaling and loads the "Waiting For Update" caption, which completely overrides the panel indefinitely.

Example code, what is commented is also used in the project, but does not affect the problem described above:
void HideChart(long achart, color BackClr){     
   //ChartSetInteger(achart, CHART_SHOW, false);
        //ChartSetInteger(achart, CHART_SHOW_OHLC, false);
        //ChartSetInteger(achart, CHART_SHOW_BID_LINE, false);
        //ChartSetInteger(achart, CHART_SHOW_ASK_LINE, false);
        //ChartSetInteger(achart, CHART_SHOW_LAST_LINE, false);
        //ChartSetInteger(achart, CHART_SHOW_PERIOD_SEP, false);
        //ChartSetInteger(achart, CHART_SHOW_GRID, false);
        //ChartSetInteger(achart, CHART_SHOW_VOLUMES, CHART_VOLUME_HIDE);
        //ChartSetInteger(achart, CHART_SHOW_OBJECT_DESCR, false);
        //ChartSetInteger(achart, CHART_SHOW_TRADE_LEVELS, false);
        //ChartSetInteger(achart, CHART_SHOW_DATE_SCALE, false);
        //ChartSetInteger(achart, CHART_SHOW_PRICE_SCALE, false);
        //ChartSetInteger(achart, CHART_FOREGROUND, false);
        //ChartSetInteger(achart, CHART_SHIFT, false);
        //ChartSetInteger(achart, CHART_MODE, CHART_LINE);

        //ChartSetInteger(achart, CHART_SCALE, 0);
        ChartSetInteger(achart, CHART_SCALEFIX, 0);
        ChartSetInteger(achart, CHART_SCALEFIX_11 , 0);
        ChartSetInteger(achart, CHART_SCALE_PT_PER_BAR, 0);
        ChartSetInteger(achart, CHART_EVENT_OBJECT_DELETE, 0);
        ChartSetInteger(achart, CHART_EVENT_OBJECT_CREATE, 0);

   	ChartSetInteger(achart, CHART_EVENT_MOUSE_WHEEL,1); 
        ChartSetInteger(achart, CHART_EVENT_MOUSE_MOVE, 0);
        ChartSetInteger(achart, CHART_MOUSE_SCROLL, 0);
        ChartSetInteger(achart, CHART_KEYBOARD_CONTROL, 0);
        ChartSetInteger(achart, CHART_QUICK_NAVIGATION, 0);
        
        //ChartSetInteger(achart, CHART_COLOR_BACKGROUND, BackClr);
        //ChartSetInteger(achart, CHART_COLOR_FOREGROUND, BackClr);
        //ChartSetInteger(achart, CHART_COLOR_CHART_LINE, BackClr);
        //ChartSetInteger(achart, CHART_COLOR_ASK, BackClr);
        //ChartSetInteger(achart, CHART_COLOR_BID, BackClr);
        //ChartSetDouble(achart, CHART_FIXED_MAX, 1);
        //ChartSetDouble(achart, CHART_FIXED_MIN, 1);
        //ChartSetString(achart, CHART_COMMENT, "");
        //ChartSetInteger(achart, CHART_CROSSHAIR_TOOL, 0);
        //ChartSetInteger(achart, CHART_SHOW_ONE_CLICK, 0);
        //ChartSetInteger(achart, CHART_CONTEXT_MENU, 0);
        ChartRedraw(achart);
}

void OnInit() {
   HideChart(0, clrWhite);
} 
 

seems to be a bug? the documentation says it's readable, but

Print(i," - ",ObjectGetInteger(0,name,OBJPROP_XDISTANCE)," - ",ObjectGetInteger(0,name,OBJPROP_XSIZE));

gives out

there is text on the chart:

full code attached

Files:
 
Igor Zakharov:

seems to be a bug? label width in documentation says readable, but

The width is only available after the object has been fully rendered.
I've been dealing with this problem recently too.

Forum on trading, automated trading systems and strategy testing

bugs, errors, questions

Sergey Dzyublik, 2020.05.12 19:32

When using OBJ_EDIT a problem arose - the need to set the size of OBJPROP_XSIZE and OBJPROP_YSIZE so that all text would fit in the corresponding object dimensions.

Question: how to determine the OBJPROP_XSIZE and OBJPROP_YSIZE sizes to fit the whole text?
I have considered two options:
1. Create OBJ_LABLE object, read the dimensions, delete OBJ_LABLE object.
Not suitable because dimensioning is only possible after the object has actually been created and is not possible when the object is in the ChartRedraw queue.

2. using TextSetFont followed by TextGetSize.
Not suitable, because the result is radically different from the results of method #1, the difference of 2.5 - 2.9 times, depending on the size of the font.
Probably the reason is 4K monitor and 175% DPI.

#define  PRINT(x) ; Print(#x, ":", string(x))
          
void SetLabel(long achart, string name, int wnd, string text, color clr, int x, int y, int corn=0, int fontsize=8, string font="Tahoma")
{
   ObjectCreate(achart, name, OBJ_LABEL, wnd, 0, 0); 
   ObjectSetInteger(achart, name, OBJPROP_CORNER, corn); 
   ObjectSetString(achart, name, OBJPROP_TEXT, text); ObjectSetInteger(achart, name, OBJPROP_COLOR, clr); 
   ObjectSetInteger(achart, name, OBJPROP_FONTSIZE, fontsize); ObjectSetString(achart, name, OBJPROP_FONT, font);
   ObjectSetInteger(achart, name, OBJPROP_SELECTABLE, false); 
   ObjectSetInteger(achart, name, OBJPROP_BORDER_TYPE, 0);
   ObjectSetInteger(achart, name, OBJPROP_XDISTANCE, x); ObjectSetInteger(achart, name, OBJPROP_YDISTANCE, y);
}

void OnStart(){     
   string obj_name = "test_obj";   
   string text = "AAAA::BBBB";
   int font_size = 7;
   string font_name = "Tahoma";
   
   SetLabel(0, obj_name, 0, text, clrWhite, 100, 100, 0, font_size, font_name);
   ChartRedraw(0);
   Sleep(1000);
   
   uint dx_fixed_0 = int(ObjectGetInteger(0, obj_name, OBJPROP_XSIZE));
   uint dy_fixed_0 = int(ObjectGetInteger(0, obj_name, OBJPROP_YSIZE));
   ObjectDelete(0, obj_name);
   
   PRINT(dx_fixed_0);
   PRINT(dy_fixed_0);
   
   
   uint dx_fixed_1;
   uint dy_fixed_1;
   TextSetFont(font_name, -10 *  font_size);
   TextGetSize(text, dx_fixed_1, dy_fixed_1);
   
   PRINT(1.0 * dx_fixed_0 / dx_fixed_1);  	// Result: 1.0
   PRINT(1.0 * dy_fixed_0 / dy_fixed_1);  	// Result: 1.0
}  


Thanks toGeess for the solution.
I should multiply by -10 the size of shuffle when passing it to TextSetFont.

 
Sergey Dzyublik:

Width is only available after the object is fully rendered.
Been dealing with this problem recently too.

Thank you! The solution is attached.


Files:
 
What flags and pitfalls could there be if one MQL program has to append something to the file (RAM-drive) all the time, and the other (and another Terminal) has to read all this appended data from it?
Reason: