MQL5 language - prevent "snapping" line to the middle of a candle automatically

 
Hello, I'm implementing custom animation in my EA and I encounter problem that I would like to fix. Basically I'm drawing a rectangle and moving one of it's sides. However, in case of vertical side, it's being snapped automatically to the middle of a candle once it encounter one of them. I would like to avoid this behaviour. Is it possible?

The code that I use for drawing and later moving it:

  string name = "cursor_vertical_line";
  if (!ObjectCreate(0, name, OBJ_RECTANGLE, 0, left, high, left, low))
  {
    return (false);
  }

  ObjectSetInteger(0, name, OBJPROP_COLOR, C'220,145,4');
  ObjectSetInteger(0, name, OBJPROP_BACK, true);
  ObjectSetInteger(0, name, OBJPROP_STYLE, STYLE_DOT);
  ObjectSetInteger(0, name, OBJPROP_WIDTH, 1);
  ObjectSetInteger(0, name, OBJPROP_RAY, false);


string name = "cursor_vertical_line";
if (!ObjectSetInteger(0, name, OBJPROP_TIME, left + vCounter))
{
return (false);
}


I'm attaching also a video of described behaviour in attachment.
Moving Average - Trend Indicators - Technical Indicators - Price Charts, Technical and Fundamental Analysis - MetaTrader 5 Help
  • www.metatrader5.com
The Moving Average Technical Indicator shows the mean instrument price value for a certain period of time. When one calculates the moving average...
 

You need to set the Terminal settings "Precise time scale" on true.

 
Alain Verleyen #:

You need to set the Terminal settings "Precise time scale" on true.

Thank you, that helped. Is there a way to set it automatically from Expert Advisor code?

 
Mikolaj Jan Migut #:

Thank you, that helped. Is there a way to set it automatically from Expert Advisor code?

Nope, not that I am aware of such option. I don't even know why this option exists at all. It should be default.
 
Dominik Christian Egert #:
Nope, not that I am aware of such option. I don't even know why this option exists at all. It should be default.
Ok, thanks, I agree, it would be better if that’s enabled by default
 
Dominik Christian Egert #:
Nope, not that I am aware of such option. I don't even know why this option exists at all. It should be default.
It depends of how you are using the platform. People using objects to draw manually on the chart certainly prefer to have the objects easily aligned with the candles.
 
Alain Verleyen #:
It depends of how you are using the platform. People using objects to draw manually on the chart certainly prefer to have the objects easily aligned with the candles.
But isn't that already also covered by the "magnetic" value?
 
Dominik Christian Egert #:
But isn't that already also covered by the "magnetic" value?

To what value is the "magnet sensitivity" refer if precise time scale is enabled ?

Anyway, these options are useful to some people and not for others, as always.