窗口函数 [Window Functions]
<-- begin content -->由 帝国程序员 在 周四, 2005-10-27 21:08 提交
datetime TimeOnDropped( )
Returns time part of dropped point where expert or script was dropped. This value is valid when expert or script dropped by mouse.
Note: For custom indicators this value is undefined.
示例:
int WindowFind( string name)
返回窗口的索引号
int WindowHandle( string symbol, int timeframe)
返回窗口的句柄
bool WindowIsVisible( int index)
返回窗口是否可见
int WindowOnDropped( )
Returns window index where expert, custom indicator or script was dropped. This value is valid when expert, custom indicator or script dropped by mouse.
示例:
int WindowsTotal( )
返回窗口数
示例:
int WindowXOnDropped( )
Returns x-axis coordinate in pixels were expert or script dropped to the chart. See also WindowYOnDropped(), WindowOnDropped()
示例:
double PriceOnDropped( )
Returns price part of dropped point where expert or script was dropped. This value is valid when expert or script dropped by mouse.
Note: For custom indicators this value is undefined.
示例:
double drop_price=PriceOnDropped();
datetime drop_time=TimeOnDropped();
//---- may be undefined (zero)
if(drop_time>0)
{
ObjectCreate("Dropped price line", OBJ_HLINE, 0, drop_price);
ObjectCreate("Dropped time line", OBJ_VLINE, 0, drop_time);
}
datetime drop_time=TimeOnDropped();
//---- may be undefined (zero)
if(drop_time>0)
{
ObjectCreate("Dropped price line", OBJ_HLINE, 0, drop_price);
ObjectCreate("Dropped time line", OBJ_VLINE, 0, drop_time);
}
datetime TimeOnDropped( )
Returns time part of dropped point where expert or script was dropped. This value is valid when expert or script dropped by mouse.
Note: For custom indicators this value is undefined.
示例:
double drop_price=PriceOnDropped();
datetime drop_time=TimeOnDropped();
//---- may be undefined (zero)
if(drop_time>0)
{
ObjectCreate("Dropped price line", OBJ_HLINE, 0, drop_price);
ObjectCreate("Dropped time line", OBJ_VLINE, 0, drop_time);
}
datetime drop_time=TimeOnDropped();
//---- may be undefined (zero)
if(drop_time>0)
{
ObjectCreate("Dropped price line", OBJ_HLINE, 0, drop_price);
ObjectCreate("Dropped time line", OBJ_VLINE, 0, drop_time);
}
int WindowFind( string name)
返回窗口的索引号
示例:
int win_idx=WindowFind("MACD(12,26,9)");
int WindowHandle( string symbol, int timeframe)
返回窗口的句柄
示例:
int win_handle=WindowHandle("USDX",PERIOD_H1);
if(win_handle!=0)
Print("Window with USDX,H1 detected. Rates array will be copied immediately.");
if(win_handle!=0)
Print("Window with USDX,H1 detected. Rates array will be copied immediately.");
bool WindowIsVisible( int index)
返回窗口是否可见
示例:
int maywin=WindowFind("MyMACD");
if(maywin>-1 && WindowIsVisible(maywin)==true)
Print("window of MyMACD is visible");
else
Print("window of MyMACD not found or is not visible");
if(maywin>-1 && WindowIsVisible(maywin)==true)
Print("window of MyMACD is visible");
else
Print("window of MyMACD not found or is not visible");
int WindowOnDropped( )
Returns window index where expert, custom indicator or script was dropped. This value is valid when expert, custom indicator or script dropped by mouse.
示例:
if(WindowOnDropped()!=0)
{
Print("Indicator 'MyIndicator' must be applied to main chart window!");
return(false);
}
{
Print("Indicator 'MyIndicator' must be applied to main chart window!");
return(false);
}
int WindowsTotal( )
返回窗口数
示例:
Print("Windows count = ", WindowsTotal());
int WindowXOnDropped( )
Returns x-axis coordinate in pixels were expert or script dropped to the chart. See also WindowYOnDropped(), WindowOnDropped()
示例:
Print("Expert dropped point x=",WindowXOnDropped()," y=",WindowYOnDropped());/div>
int WindowYOnDropped( )
Returns y-axis coordinate in pixels were expert or script dropped to the chart. See also WindowYOnDropped(), WindowOnDropped()
示例:
int WindowYOnDropped( )
Returns y-axis coordinate in pixels were expert or script dropped to the chart. See also WindowYOnDropped(), WindowOnDropped()
示例:
Print("Expert dropped point x=",WindowXOnDropped()," y=",WindowYOnDropped());
