заменить линию на квадрат
extern int rectangle_width = 100; extern int rectangle_bars = 10; ObjectCreate("V-Line",OBJ_RECTANGLE,0,Time[Place.Line.Bars.Back],Bid-rectangle_width*Point/2,Time[Place.Line.Bars.Back+rectangle_bars],Bid+rectangle_width*Point/2);
Добрый день.
Если не сложно, можете заменить вертикальную линию на квадрат, так, что бы центр квадрата находился на заданном баре на закрытии, допустим на десятом. Других координат не надо, все остальное как с обычным объектом,- выделил, раздвинул на сколько необходимо и все.
С уважением
//+------------------------------------------------------------------+
//| Vertical Line.mq4 |
//| Copyright © 2006, fxid10t@yahoo.com |
//| http://www.forexprogramtrading.com |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2006, fxid10t@yahoo.com"
#property link "http://www.forexprogramtrading.com"
#property indicator_chart_window
extern int Place.Line.Bars.Back=0;//1
extern color Line.Color=DeepSkyBlue;
extern int Line.Style=1;
extern int Line.Width=1;
extern bool Draw.as.Background=true;
int init(){return(0);}
int deinit(){ObjectDelete("V-Line"); return(0);}
int start(){
ObjectDelete("V-Line");
ObjectCreate("V-Line",OBJ_VLINE,0,Time[Place.Line.Bars.Back],Bid);
ObjectSet("V-Line",OBJPROP_COLOR,Line.Color);
ObjectSet("V-Line",OBJPROP_STYLE,Line.Style);
ObjectSet("V-Line",OBJPROP_WIDTH,Line.Width);
ObjectSet("V-Line",OBJPROP_BACK,Draw.as.Background);
return(0);}
//+------------------------------------------------------------------+