简体   繁体   English

MQL4在价格上绘制矩形

[英]MQL4 drawing rectangle over price

I am trying to write a label in a rectangle over the price in the top left corner of my chart with my custom indicator. 我正在尝试使用自定义指标在图表左上角上方的价格上方的矩形中书写一个标签。 I can draw the rectangle and the label fine but I cannot get the order in which they display correct. 我可以绘制矩形和标签,但是我无法获得它们显示正确的顺序。 The candlestick chart is always at the top and I can switch around the label and the rectangle's orders by using the following code 烛台图始终位于顶部,我可以使用以下代码在标签和矩形的顺序之间切换

ObjectSetInteger(NULL, "objBackground", OBJPROP_BACK,true);

Please help, how do I put the candlesticks at the back, then the rectangle and the label(s) at the the forefront? 请帮忙,如何将烛台放在后面,然后将矩形和标签放在最前面?

Thanks for your help! 谢谢你的帮助!

Just make chart not on the foreground and you will see objects on top 只是使图表不在前台,您将在顶部看到对象

bool ChartForegroundSet(const bool value,const long chart_ID=0)
  {
   //--- reset the error value
   ResetLastError();
   //--- set property value
   if(!ChartSetInteger(chart_ID,CHART_FOREGROUND,0,value))
    {
     //--- display the error message in Experts journal
     Print(__FUNCTION__+", Error Code = ",GetLastError());
     return(false);
    }
   //--- successful execution
   return(true);
  }

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM