MQL4 - automated forex trading   /  

Documentation

MQL4 Reference  Window functions  WindowOnDropped

 
Use the opportunities of
MQL5 in MetaTrader 5
Study the new MQL5 language
Study the new MQL5 language.
Reference is already available
int WindowOnDropped( )
Returns window index where expert, custom indicator or script was dropped. This value is valid if the expert, custom indicator or script was dropped by mouse.
Note: For custom indicators being initialized (call from the init() function), this index is not defined.
The returned index is the number of window (0-chart main menu, subwindows of indicators are numbered starting from 1) where the custom indicator is working. A custom indicator can create its own new subwindow during its work, and the number of this subwindow will differ from that of the window where the indicator was really dropped in.
See also WindowXOnDropped(), WindowYOnDropped()
Sample:
if(WindowOnDropped()!=0)
  {
   Print("Indicator 'MyIndicator' must be applied to main chart window!");
   return(false);
  }