How to position an arrow?

 
Hello

I cannot find any working example about OBJPROP_XDISTANCE.

I would like to position and arrow
ObjectSet(up_ar, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);


above the last high or below the last low bar.

Here is what i'm trying:

      ObjectCreate(up_ar, OBJ_ARROW, 0, iTime(NULL, 0, 0), iClose(NULL, 0, 0) ); // create the arrow
      ObjectSetText(up_ar, "Buy!", 10, NULL, Lime);        // attach a lable to the arrow
      ObjectSet(up_ar, OBJPROP_ARROWCODE, SYMBOL_ARROWUP);  // chose symbol
      ObjectSet(up_ar, OBJPROP_COLOR, Lime);  // and color
      ObjectSet(up_ar, OBJPROP_WIDTH, 5);       // and width


ObjectSet(up_ar, OBJPROP_YDISTANCE, ObjectGet(dw_ar, OBJPROP_YDISTANCE)+50); // vertical positioning attempt
ObjectSet(up_ar, OBJPROP_XDISTANCE, ObjectGet(dw_ar, OBJPROP_XDISTANCE)+50); // horisontal positioning attempt

      ObjectsRedraw();          // let's see what is done ;-)



There is no effect. How to position the arrow correctly?

Thanks

Ivo

 
x-distance and y-distance are applied to TextLabel object only
for Arrow object should be used time and price coordinates
 
x-distance and y-distance are applied to TextLabel object only
for Arrow object should be used time and price coordinates


Would you give me a sample please? 10x

Ivo
 
 

Thank You, Ivo, for collaboration :-)
Reason: