shift box on side of a candle

 

Hi all,


I need to shift a box object to be drawn starting from the left-side of the candle, not from the center.. is there a function to do this?

Thanks

 
Mindexperiment:

Hi all,


I need to shift a box object to be drawn starting from the left-side of the candle, not from the center.. is there a function to do this?

Thanks

No, it's not possible with MT4, you can do it with MT5.
 
Mindexperiment:

Hi all,


I need to shift a box object to be drawn starting from the left-side of the candle, not from the center.. is there a function to do this?

Thanks


RaptorUK:
No, it's not possible with MT4, you can do it with MT5.


possible if you attach the stringlength+1 to the string then you can get the text starting at the left or the right side

 
deVries:


possible if you attach the stringlength+1 to the string then you can get the text starting at the left or the right side

Text ? the OP was asking about a Box though, did I get the wrong end of the stick
 
RaptorUK:
Text ? the OP was asking about a Box though, did I get the wrong end of the stick


yes for text

text is also inside a box i thought

if you place text to a point of a candle then you get the text normally in the middle also

if you double the textlength +1 you can put the text to the left or the right of the candel

 
deVries:


yes for text

text is also inside a box i thought

if you place text to a point of a candle then you get the text normally in the middle also

if you double the textlength +1 you can put the text to the left or the right of the candel

OK, but I thought the OP is talking about OBJ_RECTANGLE, it seems clear to me that he/she is . . .
 
RaptorUK:
OK, but I thought the OP is talking about OBJ_RECTANGLE, it seems clear to me that he/she is . . .


That is my understanding also
 
box

I'm talking about


ObjectCreate("box", OBJ_RECTANGLE, 0, Time[0], low, time4HT1, high);


the box is built on 4H candle and the result is shown below.. as you can see the box start from the center of the candle..

 
Mindexperiment:

I'm talking about


ObjectCreate("box", OBJ_RECTANGLE, 0, Time[0], low, time4HT1, high);


the box is built on 4H candle and the result is shown below.. as you can see the box start from the center of the candle..

All Objects have their anchors aligned to candles . . . there is nothing else you can do with MT4
 
RaptorUK:
OK, but I thought the OP is talking about OBJ_RECTANGLE, it seems clear to me that he/she is . . .

OBJ_RECTANGLE, is colored between two timepoints
we don't have timepoints between two candels if you want to start OBJ_RECTANGLE left-side of the candel you have to start one Period() earlier

 
double low = iLow(NULL, PERIOD_H4, 0);
double high = iHigh(NULL, PERIOD_H4, 0);

datetime time4HT1 = iTime(NULL, PERIOD_H4, 0);

ObjectCreate("box", OBJ_RECTANGLE, 0, Time[0], low, time4HT1, high);
ObjectSet("box",OBJPROP_BACK,false);
ObjectSet("box", OBJPROP_COLOR, PowderBlue);
ObjectSet("box", OBJPROP_STYLE, STYLE_DASH);

ok,


so maybe I can build a workaround and, at least, center the box on the first 1M candle of the whole 4H.. any idea?

a bit of code for 1 box: