不会画图形,请教为什么画不出来

 

以下是我写的在顶分型和底分型处放置向下和向上箭头图形的代码,为什么printf(“aaaaaaaaaaaaa”)能够执行,但箭头图形却不能显示出来?我不会创建图形,关于图形方面的代码是在帮助文件里粘贴过来的。麻烦帮助看一下哪里出问题了,谢谢。

//--- 描述
#property description "Script draws \"Arrow Up\" sign."
#property description "Anchor point coordinate is set in"
#property description "percentage of the chart window size."
//--- 启动脚本期间显示输入参数的窗口
#property script_show_inputs
//--- 脚本的输入参数
input string            InpName="ArrowUp";    // 符号名称
input int               InpDate=25;           // 定位点日期在%
input int               InpPrice=25;          // 定位点价格在 %
input ENUM_ARROW_ANCHOR InpAnchor=ANCHOR_TOP; // 定位类型
input color             InpColor=clrRed;      // 符号颜色
input ENUM_LINE_STYLE   InpStyle=STYLE_DOT;   // 边界线条风格
input int               InpWidth=5;           // 符号大小
input bool              InpBack=false;        // 背景符号
input bool              InpSelection=false;   // 突出移动
input bool              InpHidden=true;       // 隐藏对象列表中
input long              InpZOrder=0;          //
datetime timeNow=iTime(Symbol(),PERIOD_CURRENT,0);    //用来识别新K线的变量

int OnInit()
  {
//--- create timer

//---
   return(INIT_SUCCEEDED);
  }
//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
//--- destroy timer
   ObjectsDeleteAll(0,"",0,-1);//删除当前图表所有对象
   EventKillTimer();//反初始化销毁计时器
   Comment("");//清除左上角注释
   EventKillTimer();
   
  }
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
//---
   if(isNewK())
      top_bottom();

     
   //
  }


//+-------------------------检测新K线函数--------------------------+
bool isNewK()                 
{
   bool isnewk=false;
   datetime timeLast=iTime(Symbol(),PERIOD_CURRENT,0);
   if(timeLast!=timeNow)
   {
      isnewk=true;
      timeNow=timeLast;
      printf("新K线出现");
   }
   else
     isnewk=false;
  return isnewk;
}
//+------------------------检测顶分型和底分型函数--------------------+
void top_bottom()
{
   double high_price[3];         //定义存储K线最高价的数组
   double low_price[3];          //定义存储K线最低价的数组
   
   for(int i=2;i>=0;i--)
   {
      high_price[i]=iHigh(Symbol(),PERIOD_CURRENT,i+1);           //将1、2、3号K线的最高价分别存到数组high_price0、1、2单元
      low_price[i]=iLow(Symbol(),PERIOD_CURRENT,i+1);             //将1、2、3号K线的最低价分别存到数组low_price0、1、2单元
      
      if(high_price[1]>high_price[0] && high_price[1]>high_price[2] && low_price[1]>low_price[0] && low_price[1]>low_price[2])
        {
         ArrowCreate(0,"ArrowUp",0,2,2,ANCHOR_BOTTOM,clrRed,STYLE_SOLID,3,false,true,true,0);
         printf("aaaaaaaaaaaaaaaaaaaaaa");
        }
                                                             //顶分型
       else if(low_price[1]<low_price[0] && low_price[1]<low_price[2] && high_price[1]<high_price[0] && high_price[1]<high_price[2])
          {
            ArrowCreate(0,"Arrowbottom",0,2,2,ANCHOR_TOP,clrRed,STYLE_SOLID,3,false,true,true,0);
            printf("cccccccccccccc");
          }
           
   }
  //判断顶底分型
                                                       //底分型
}
//+------------------------------------------------------------------+
//| 创建箭头向上符号                                                   |
//+------------------------------------------------------------------+
bool ArrowCreate(const long              chart_ID=0,           // 图表 ID
                   const string            name="ArrowUp",       // 符号名称
                   const int               sub_window=0,         // 子窗口指数
                   datetime                time=0,               // 定位点时间
                   double                  price=0,              // 定位点价格
                   ENUM_ARROW_ANCHOR       anchor=ANCHOR_BOTTOM, // 定位类型
                   color                   clr=clrRed,           // 符号颜色
                   ENUM_LINE_STYLE         style=STYLE_SOLID,    // 边界线条风格
                   int                     width=3,              // 符号大小
                   bool                    back=false,           // 在背景中
                   bool                    selection=true,       // 突出移动
                   bool                    hidden=true,          // 隐藏在对象列表
                   long                    z_order=0)            // 鼠标单击优先
  {
//--- 重置错误的值
   ResetLastError();
//--- 创建符号
   if(!ObjectCreate(chart_ID,name,OBJ_ARROW_UP,sub_window,time,price))
     {
      Print(__FUNCTION__,
            ": failed to create \"Arrow Up\" sign! Error code = ",GetLastError());
       return(false);
     }
//--- 设置定位类型
   ObjectSetInteger(chart_ID,name,OBJPROP_ANCHOR,anchor);
//--- 设置符号颜色
   ObjectSetInteger(chart_ID,name,OBJPROP_COLOR,clr);
//--- 设置边界线条风格
   ObjectSetInteger(chart_ID,name,OBJPROP_STYLE,style);
//--- 设置符号大小
   ObjectSetInteger(chart_ID,name,OBJPROP_WIDTH,width);
//--- 显示前景 (false) 或背景 (true)
   ObjectSetInteger(chart_ID,name,OBJPROP_BACK,back);
//--- 启用 (true) 或禁用 (false) 通过鼠标移动符号的模式
//--- 当使用ObjectCreate函数创建图形对象时,对象不能
//--- 默认下突出并移动。在这个方法中,默认选择参数
//--- true 可以突出移动对象
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTABLE,selection);
   ObjectSetInteger(chart_ID,name,OBJPROP_SELECTED,selection);
//--- 在对象列表隐藏(true) 或显示 (false) 图形对象名称
   ObjectSetInteger(chart_ID,name,OBJPROP_HIDDEN,hidden);
//--- 设置在图表中优先接收鼠标点击事件
   ObjectSetInteger(chart_ID,name,OBJPROP_ZORDER,z_order);
//--- 成功执行
   return(true);
  }
//+------------------------------------------------------------------+

//| 删除箭头向上符号                                                   |
//+------------------------------------------------------------------+
bool ArrowUpDelete(const long   chart_ID=0,     // 图表 ID
                   const string name="ArrowUp") // 符号名称
  {
//--- 重置错误的值
   ResetLastError();
//--- 删除符号
   if(!ObjectDelete(chart_ID,name))
     {
      Print(__FUNCTION__,
            ": failed to delete \"Arrow Up\" sign! Error code = ",GetLastError());
       return(false);
     }
//--- 成功执行
   return(true);
  }
//+------------------------------------------------------------------+
//| 检查定位点的值和为空点设置                                           |
//| 默认的值                                                          |
//+------------------------------------------------------------------+

//+------------------------------------------------------------------+
//| 脚本程序起始函数                                                   |
//+------------------------------------------------------------------+

 
在线等