One solution to make it anchor to the right is:
replacing x==> chart_width-x
//+------------------------------------------------------------------+ //| AGT_EA.mq5 | //| Ottoman_Empire | //| https://www.otto-trading.com | //+------------------------------------------------------------------+ #property copyright "Ottoman_Empire" #property link "https://www.otto-trading.com" #property version "1.00" //+------------------------------------------------------------------+ //| Defines | //+------------------------------------------------------------------+ #define bgFix (C'0xF7,0xF7,0xF7') //+------------------------------------------------------------------+ //| Include App Classes | //+------------------------------------------------------------------+ #include <Controls\Dialog.mqh> #include <Controls\Button.mqh> #include <Controls\RadioGroup.mqh> #include <Controls\Label.mqh> #include <Controls\Edit.mqh> #include <Controls\CheckBox.mqh> #include <Controls\ComboBox.mqh> #include <SpinEditDouble.mqh> CAppDialog loginPanel; CButton loginButton1; CEdit loginInputBox; CLabel loginText1; //+------------------------------------------------------------------+ //| Expert initialization function | //+------------------------------------------------------------------+ int OnInit(){ if(!loginApp()){ return(INIT_FAILED); } //--- run application loginPanel.Run(); //--- succeed return(INIT_SUCCEEDED); } //+------------------------------------------------------------------+ //| Expert deinitialization function | //+------------------------------------------------------------------+ void OnDeinit(const int reason){ //--- destroy dialog loginPanel.Destroy(reason); } //+------------------------------------------------------------------+ //| Login App | //+------------------------------------------------------------------+ bool loginApp(){ long m_chart_id = ChartID(); long heightScreen=ChartGetInteger(m_chart_id,CHART_HEIGHT_IN_PIXELS,0); long widthScreen=ChartGetInteger(m_chart_id,CHART_WIDTH_IN_PIXELS,0); int height = 130;//Panel Height int width = 200;//Panel Width //Standart place int x1 =3; int y1 =82; int x2 = x1+width; int y2 = y1+height; int dialogPlace = 5;//Here is placing code if(dialogPlace ==5){//Center x1 = int(widthScreen/2 - (width/2)); y1 = int(heightScreen/2 - (height/2)); x2 = x1+width; y2 = y1+height; }else if(dialogPlace ==4){//Right Down x1 = int(widthScreen-width); y1 = int(heightScreen-height); x2 = x1+width; y2 = y1+height; }else if(dialogPlace ==3){//Right Top x1 = int(widthScreen-width); y1 = 0; x2 = x1+width; y2 = y1+height; }else if(dialogPlace ==2){//Left Down x1 = 0; y1 = int(heightScreen-height); x2 = x1+width; y2 = y1+height; }else if(dialogPlace ==1){//Left Top x1 = 0; y1 = 0; x2 = x1+width; y2 = y1+height; } if(!loginPanel.Create(m_chart_id,"Password",0,x1,y1,x2,y2)){ return(false); } //Login Text 1 if(!loginText1.Create(m_chart_id,"loginText1",0,5,10,0,0)) return(false); if(!loginText1.Text("Password:")) return(false); if(!loginText1.Color(clrGray)) return(false); if(!loginText1.Font("Calibri")) return(false); if(!loginText1.FontSize(10)) return(false); if(!loginPanel.Add(loginText1)) return(false); //Login Input Box if(!loginInputBox.Create(m_chart_id,"loginInputBox",0,65,6,187,27)) return(false); if(!loginInputBox.Color(clrGray)) return(false); if(!loginPanel.Add(loginInputBox)) return(false); //Login Button 1 if(!loginButton1.Create(m_chart_id,"loginButton1",0,5,60,187,95)) return(false); if(!loginButton1.Text("Login")) return(false); if(!loginButton1.Font("Calibri Bold")) return(false); if(!loginButton1.FontSize(12)) return(false); if(!loginButton1.ColorBackground(clrAliceBlue)) return(false); if(!loginPanel.Add(loginButton1)) return(false); return(true); } //+------------------------------------------------------------------+ //| Expert chart event function | //+------------------------------------------------------------------+ void OnChartEvent(const int id, // event ID const long& lparam, // event parameter of the long type const double& dparam, // event parameter of the double type const string& sparam) // event parameter of the string type { loginPanel.ChartEvent(id,lparam,dparam,sparam); }
You can control like this. (Edit: OnChartEvent functions added)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am attaching the code. thanks very much