Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 546

 
Vladimir M.:

It is not defined, it is set.

sub_window

[in] Subwindow number of the chart. 0 means the main window of the graph. The specified subwindow must exist, otherwise the function returns false.

The indicator on the EURJPY chart must create an object in the main window of the USDJPY chart:

intsub_window,// window index???

 
Taras Slobodyanik:

WindowFind

WindowsTotal

No good. There is no indicator where you want to create an object. WindowFind searches for a window by indicator name.

 
khorosh:

The indicator on the EURJPY chart must create an object in the main window of the USDJPY chart, which should be written in :

intsub_window,// window index???

0
 
Vladimir M.:
0

Thanks, I did. It's working.

 
How can MQL5 (or WinAPI) expand the chart to full screen???
 
Andrii Djola:
How can I expand a chart to the full screen in MQL5 (or using WinAPI)?

Found CHART_IS_MAXIMIZE and CHART_IS_MINIMIZE properties in documentation. They are not described as read-only, but nevertheless changing them does not lead to anything. The properties are read correctly.

Everything works through WinAPI:

#define  SW_MAXIMIZE   3          // Maximizes the specified window.
#define  SW_MINIMIZE   6          // Minimizes the specified window and activates the next top-level window in the Z order.
#define  SW_RESTORE    9          // Activates and displays the window

#import "user32.dll"
   int GetParent(int hWnd);
   bool ShowWindow(int hWnd, int nCmdShow);
#import

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
{  
   int hChartWnd = int(ChartGetInteger(0, CHART_WINDOW_HANDLE));
   if (!hChartWnd)
   {
      Alert("Ошибка получения дескриптора чарта. Error: ", GetLastError());
      return;
   }
   
   int hSymbolWnd = GetParent(hChartWnd);
   if (!hChartWnd)
   {
      Alert("Ошибка получения дескриптора окна символа. Error: ", GetLastError());
      return;
   }
   
   ShowWindow(hSymbolWnd, SW_MAXIMIZE);
}
 
Ihor Herasko:

Found CHART_IS_MAXIMIZE and CHART_IS_MINIMIZE properties in documentation. They are not described as read-only, but nevertheless changing them does not lead to anything. The properties are read correctly.

But everything works through WinAPI:

Thank you very much.

 

Hello. Can you please tell me how to connect a market profile indicator to an EA if it doesn't have a buffer? I've already wracked my brains(!

Please attach the indicator

 
voron_026:

Hello. Can you please tell me how to connect a market profile indicator to an EA if it doesn't have a buffer? I've already wracked my brains(!

Please attach the indicator

Only repeat the calculation of levels in the Expert Advisor. After all, the profile is displayed using graphical objects.

 

If you don't mind my saying so. Could you please tell me exactly where in the code the calculation starts? It's hard to understand.

And if I understand correctly, this part needs to be inserted into the EA code as a custom function?

Reason: