当前位置:首页 > MQL4开发人员手册

窗口函数 [Window Functions]

时间:2008-09-28 15:06:45  来源:  作者:

窗口函数 [Window Functions]

<-- begin content -->
由 帝国程序员 在 周四, 2005-10-27 21:08 提交

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 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);
}

int WindowFind( string name)
返回窗口的索引号

    :: 输入参数
    name - 指标简称

示例:

int win_idx=WindowFind("MACD(12,26,9)");

int WindowHandle( string symbol, int timeframe)
返回窗口的句柄

    :: 输入参数
    symbol - 通货标识
    timeframe - 时间线

示例:

int win_handle=WindowHandle("USDX",PERIOD_H1);
if(win_handle!=0)
Print("Window with USDX,H1 detected. Rates array will be copied immediately.");

bool WindowIsVisible( int index)
返回窗口是否可见

    :: 输入参数
    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");

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);
}

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()
示例:
Print("Expert dropped point x=",WindowXOnDropped()," y=",WindowYOnDropped());

来顶一下
近回首页
返回首页
发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
This site was designed & Modified by beok.net. Last ModiMon, 08/11/2008 0:05 AMe --> Beijing Time.