ObjectCreate Exactly On Bid Price Line

 

I can create a "dot" object just fine, the problem is that the dot shows up around 10 pips below the bid price, I would like for it to show exactly on the bid price line.


void DrawDot(string DotName,double LinePrice,color LineColor)
{
   if (ObjectFind(DotName)<0)
   {
      ObjectCreate(0, DotName, OBJ_ARROW, 0, Time[0], LinePrice); 
      ObjectSet(DotName, OBJPROP_COLOR, LineColor);
      ObjectSet(DotName, OBJPROP_ARROWCODE, 159);
   }
}

DrawDot("Test", Bid, clrRed);   //call of ObjectCreate function

Notice that I have set the price parameter to "Bid" but the object doesn't appear exactly on (ontop of) the candle at the bid price?

 
twostarii:

I can create a "dot" object just fine, the problem is that the dot shows up around 10 pips below the bid price, I would like for it to show exactly on the bid price line.



Notice that I have set the price parameter to "Bid" but the object doesn't appear exactly on (ontop of) the candle at the bid price?

Bid is always changing, update your object's price.
 
twostarii: I would like for it to show exactly on the bid price line.
  1. The wingdings appear centered on the price specified. To align them to top, bottom, or hot spot (arrow end) means you have to offset them where the offset varies with the price scaling. I've done that for a majority of them. See: Can I change the symbol of the original built-in Bill Williams Fractals indicator? - Indices - MQL4 programming forum #2 & #4 2020.06.18
  2. Most likely, you shouldn't be creating objects but instead be using arrow buffers in your indicators. Again see the code.
 
When using wingdings you can change the alignment by using the ObjectSetInteger(..,OBJPROP_ANCHOR,..) property and set it to ANCHOR_BOTTOM or ANCHOR_TOP.
Reason: