请高手帮忙添加K线走完后弹窗报警功能
//+------------------------------------------------------------------+
//| 当前K线剩余时间-新版.mq4 |
//| Copyright 2014, MetaQuotes Software Corp. |
//| http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link "http://www.mql5.com"
#property version "1.00"
#property strict
#property indicator_chart_window
extern bool zhuisuijiage_shifou = TRUE;
extern color zhuisuijiage_yanse = Yellow;
extern bool gudingxianshi_shifou = FALSE;
extern color gudingxianshi_yanse= Blue;
int OnInit()
{
//--- indicator buffers mapping
//---
return(INIT_SUCCEEDED);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
int l_ind_counted_0 = IndicatorCounted();
int li_12 =int( Time[0] + 60 * Period() - TimeCurrent());
double ld_4 = li_12 / 60.0;
int li_16 = li_12 % 60;
li_12 = (li_12 - li_12 % 60) / 60;
if (zhuisuijiage_shifou)
{
if (ObjectFind("time") != -1) ObjectDelete("time");
ObjectCreate("time", OBJ_TEXT, 0, Time[0], Close[0] + 0.0005);
ObjectSetText("time", " <--" + string(li_12) + ":" +string(li_16), 13, "Verdana", zhuisuijiage_yanse);
ObjectMove("time", 0, Time[0], Close[0] + 0.0005);
}
if (gudingxianshi_shifou)
{
if (ObjectFind("LeftTime") != -1) ObjectDelete("LeftTime");
ObjectCreate("LeftTime", OBJ_LABEL, 0, 0, 0);
ObjectSet("LeftTime", OBJPROP_XDISTANCE, 10);
ObjectSet("LeftTime", OBJPROP_YDISTANCE, 20);
ObjectSetText("LeftTime", "当前K线剩余时间: " + string(li_12) + ":" + string(li_16), 10, "宋体", gudingxianshi_yanse);
}
return(rates_total);
}
//+------------------------------------------------------------------+
|