如何在主图表上的对象上方创建一条短的水平线?

时间:2019-11-30 00:05:38

标签: mql4

This is what i want to do // + --------------------------------------- --------------------------- +

// Arrow
   SetIndexStyle(2,DRAW_ARROW);
   SetIndexArrow(2,159); // 233
   SetIndexEmptyValue(2,0.0);
   SetIndexLabel(2,"Buy");
   SetIndexDrawBegin(2,draw);
   SetIndexBuffer(2,drawArrow_one);
   SetIndexStyle(3,DRAW_ARROW);
   SetIndexArrow(3,159); // 234
   SetIndexLabel(3,"Sell");
   SetIndexDrawBegin(3,draw);
   SetIndexBuffer(3,drawArrow_two);
  }
       int limit=rates_total-prev_calculated;
   if(prev_calculated>0) limit++;
   for(i=limit-1; i>=0; i--)
     {
      // Line
      maOne[i] = iMA( Symbol(), 0, 13, 0, MODE_EMA, PRICE_CLOSE, i + 1 );
      maTwo[i] = iMA( Symbol(), 0, 26, 0, MODE_EMA, PRICE_CLOSE, i + 1 );
      maOne_Previous[i] = iMA( Symbol(), 0, 13, 0, MODE_EMA, PRICE_CLOSE, i + 2 );
      maTwo_Previous[i] = iMA( Symbol(), 0, 26, 0, MODE_EMA, PRICE_CLOSE, i + 2 );

      if(maOne_price>maTwo_price && maOne_Previous_price<=maTwo_Previous_price)
        {
         drawArrow_one[i]=Low[i]-70*Point;
        }else if(maOne_price<maTwo_price && maOne_Previous_price>=maTwo_Previous_price){
         drawArrow_one[i]=High[i]+70*Point;
         ObjectCreate(current_chart_id,obj_name,OBJ_HLINE,0,0,(Close[i]+(Point*400)));
        }
     }
//+------------------------------------------------------------------+

在它创建一个蓝点之后(由上面的drawArrow_one [i]完成),我想在蓝点上方尽可能多地创建一条短的水平线,并分开指定的点数。我用ObjectCreate();但是没有用。救命!

丹尼尔(Daniel)非常感谢,您一直在回答我的问题。

如果您查看图像(向上箭头表示购买,向下箭头表示出售)。立即出现箭头,我要绘制一条如图所示的短水平线,向下箭头上方X点(例如25点)(如果显示的是向上箭头,则向上箭头下方X点)。

我粘贴的代码绘制了一条很长的水平线。提前感谢Daniel的帮助

0 个答案:

没有答案