Blue border surrounding two candles

烈酒焚心 提交于 2019-12-12 02:17:13

问题


I hope to draw a graph like this (with blue border surrounding two candles)

with the following code,

      string label_name="Rectangle";
  double maxHigh=MathMax(iHigh(_Symbol,0,1),iHigh(_Symbol,0,2));
          double minLow=MathMin(iLow(_Symbol,0,1),iLow(_Symbol,0,2));
            ObjectCreate(0,label_name, OBJ_RECTANGLE_LABEL, 0, Time[2],maxHigh, Time[1],minLow);
            ObjectSetInteger(0,label_name,OBJPROP_XSIZE,100);
            ObjectSetInteger(0,label_name,OBJPROP_COLOR,clrBlue);
            ObjectSetInteger(0,label_name,OBJPROP_BACK,false);
            ObjectSetInteger(0,label_name,OBJPROP_WIDTH,3);

i get the following (not surrounding the candle), how should I make it work?


回答1:


do you need OBJ_RECTANGLE_LABEL? it can be useful if you want to have some kind of background, and when you move your chart right or left it remains in the selected corner. It's position depends on x and y coordinates of the chart, width and heigth. If you use OBJ_RECTANGLE - it would be drawn based on price and time coordinates, no need in editing OBJPROP_XSIZE in such case, just ObjectSetDouble(0,name,OBJPROP_PRICE1,fmax(high[1],high[2]); ObjectSetDouble(0,name,OBJPROP_PRICE2,fmin(low[1],low[2]);



来源:https://stackoverflow.com/questions/42674261/blue-border-surrounding-two-candles

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!