Questions from Beginners MQL5 MT5 MetaTrader 5 - page 1507

 
Aleksandr Slavskii #:

I've been using this code for a long time.

Thank you! I'll try this and get back. 
 
Aleksandr Slavskii #:

I've been using this code for a long time.

It works! Thank you, sir!
 
Can you please tell me how to transfer money from my Baybit account to MQL5 Environment?
 
Максим Пирожков #:
Can you please tell me how to transfer money from my Baybit account to the MQL5 environment?
But here the money will be on your account and you can use it only to pay for local services.
 

Can you tell me how to click the button to expand the window (i.e. the chart) from the service (EA)? There is a function ChartGetInteger with the parameter CHART_IS_MAXIMIZED, but this property is read-only. Maybe there is some non-programming way ?

The way I do it. 0) I close all windows. 1) I open the chart via ChartOpen 2) I load a template on it using ChartApplyTemplate. The window is always not maximally expanded. If there are 100 such windows, it does not look very good. I always have to expand the EA window myself to evaluate the work of the Expert Advisor.

Документация по MQL5: Константы, перечисления и структуры / Константы графиков / Примеры работы с графиком
Документация по MQL5: Константы, перечисления и структуры / Константы графиков / Примеры работы с графиком
  • www.mql5.com
Примеры работы с графиком - Константы графиков - Константы, перечисления и структуры - Справочник MQL5 - Справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
pivomoe #:
Can you tell me how to click from the service(EA) to expand the window i.e. chart ?

I can't check, but:

#include <WinAPI\WinUser.mqh>

int hWnd = (int)ChartGetInteger(0, CHART_WINDOW_HANDLE, 0);
ShowWindow(hWnd, SW_SHOWMAXIMIZED);
 
trader6_1 #:

I can't verify it, but:

only GetParent is also needed once or twice (I don't remember how many :-) )

and this is from the build, the authors may well change the structure of window nesting.

I mean it's not good to do it this way, only out of desperation.

 
Maxim Kuznetsov #:
but you also need GetParent
void arrangeHorizontal() {
   long y = TerminalInfoInteger(TERMINAL_TOP);
   long h = TerminalInfoInteger(TERMINAL_BOTTOM);
   int hWnd = (int)ChartGetInteger(0, CHART_WINDOW_HANDLE, 0);
   SetWindowPos(GetParent(hWnd), 0, 0, 0, 225, h - y, 0);
}
 
trader6_1 #:
GetParent

Thanks guys. I combined your answers, indexed a bit and it worked:

#include <WinAPI\WinUser.mqh>

void arrangeHorizontal3()
  {
   int hWnd = (int)ChartGetInteger(0, CHART_WINDOW_HANDLE, 0);
   ShowWindow (GetParent(hWnd),3); 
  }
 
Hello!
I create a button using Controls\Button.mqh library and a panel using: Controls\Dialog.mqh
.
for(int i=0; i<SymbolsTotal(true);i++){ 
btn1.Create(0,"btn"+(string) i,0,0,0+BTN_HEIGHT+btn_left,0,0+BTN_WIDTH*btn_line);
ExtDialog.Add(btn1);
}

And then I add the created button to the panel and move the panel a little bit as a result I get:



This leads to two questions
1) How can I bind all buttons if I use the variable "i" equal to the number of characters when creating them?
2) How can I prevent the panel created through the library from moving?

Reason: