MQL4 Reference Chart Operations WindowOnDropped

WindowOnDropped

Returns the window index where Expert Advisor, custom indicator or script was dropped.

int  WindowOnDropped();

Parameters

None.

Returned value

The window index where Expert Advisor, custom indicator or script was dropped. This value is valid if the Expert Advisor, 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.

Example:

  if(WindowOnDropped()!=0)
    {
     Print("Indicator 'MyIndicator' must be applied to main chart window!");
     return(false);
    }

See also

WindowXOnDropped(), WindowYOnDropped()