Use a rectangle label, you can set the Y size to 1 or 2 pixels
Line_Trader:
How to draw a horizontal line on a MT4 chart without taking quotes into account? So the markets can move but the line stays at same height.
I want to make a scatter plot within a MT4 chart and this should stay fixed on the chart, not move with the quotes.
By using this code it moves with the quotes:
ObjectCreate( "XLine", OBJ_HLINE, 0, Time[0], Bid );
- Once you create the HLINE it is done. Calling ObjectCreate again fails (the object already exists.) The line is always at the "same height," it does not "move with quotes." You must be deleting the line and recreating it.
- You must use different names for different objects.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
How to draw a horizontal line on a MT4 chart without taking quotes into account? So the markets can move but the line stays at same height. I want to make a scatter plot within a MT4 chart and this should stay fixed on the chart, not move with the quotes.
By using this code it moves with the quotes:
Why can't it be done like this: