I want attache the CAppDialog to the the MACD graph.

 

Hi,

Here is the code :

//+------------------------------------------------------------------+
//|                                              LearnCAppDialog.mq5 |
//|                        Copyright 2018, MetaQuotes Software Corp. |
//|                                             https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2018, MetaQuotes Software Corp."
#property link      "https://www.mql5.com"
#property version   "1.00"
#include <Controls\Dialog.mqh>

CAppDialog AppWindow;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//--- create application dialog
   if(!AppWindow.Create(1,"AppWindow",0,20,20,360,324))
     {
      MessageBox("AppWindow not created");
      return(INIT_FAILED);
     }
   else
     {
      MessageBox("AppWindow created");
     }
//--- run application
   AppWindow.Run();
//--- succeed
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy dialog
   AppWindow.Destroy(reason);
  }
//+------------------------------------------------------------------+
//| 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
  {
   AppWindow.ChartEvent(id,lparam,dparam,sparam);
  }
//+------------------------------------------------------------------+


If I write this code, it's OK but the CAppDialog is atache at the EUR/USD graph, and I want attache it to the the MACD graph.

   if(!AppWindow.Create(0,"AppWindow",0,20,20,360,324))

If I write this code, no CAppDialog are created.
It fail.

   if(!AppWindow.Create(1,"AppWindow",0,20,20,360,324))
 
Pierre Rougier:

Hi,

Here is the code :


If I write this code, it's OK but the CAppDialog is atache at the EUR/USD graph, and I want attache it to the the MACD graph.

If I write this code, no CAppDialog are created.
It fail.

looks like you are attaching to the main window of the chart instead of the subwindow where the indi is located.

AppWindow.Create(ChartID,"AppWindow",subwindow,XPos,YPos,XSize,YSize)

AppWindow.Create(0,"AppWindow",0,20,20,360,324)

Reason: