I'm new to mql programming and I need to draw a horizontal line on a specific level (for example: 1.25000) I tried "void LineHorizontal(x1,x2,y1,clr)" but I don't know if any function or library should be called at first, I would appreciate it if somebody help me to draw my first horizontal line in Meta 5 using mql5 :)

Documentation on MQL5: Constants, Enumerations and Structures / Objects Constants / Object Types
- www.mql5.com
Object Types - Objects Constants - Constants, Enumerations and Structures - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
aWing:
I'm new to mql programming and I need to draw a horizontal line on a specific level (for example: 1.25000) I tried "void LineHorizontal(x1,x2,y1,clr)" but I don't know if any function or library should be called at first, I would appreciate it if somebody help me to draw my first horizontal line in Meta 5 using mql5 :)
I'm new to mql programming and I need to draw a horizontal line on a specific level (for example: 1.25000) I tried "void LineHorizontal(x1,x2,y1,clr)" but I don't know if any function or library should be called at first, I would appreciate it if somebody help me to draw my first horizontal line in Meta 5 using mql5 :)
here you go
double Price = 3880.00; ObjectCreate(0,"My Line",OBJ_HLINE,0,0,Price);
https://www.mql5.com/en/docs/objects/objectcreate

Documentation on MQL5: Object Functions / ObjectCreate
- www.mql5.com
ObjectCreate - Object Functions - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
You can try "indicator_levelN", check this: https://www.mql5.com/en/docs/basis/preprosessor/compilation#:~:text=starts%20from%201-,indicator_levelN,-double

Documentation on MQL5: Language Basics / Preprocessor / Program Properties (#property)
- www.mql5.com
Program Properties (#property) - Preprocessor - Language Basics - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
enel1jk #:
You can try "indicator_levelN", check this: https://www.mql5.com/en/docs/basis/preprosessor/compilation#:~:text=starts%20from%201-,indicator_levelN,-double
You can try "indicator_levelN", check this: https://www.mql5.com/en/docs/basis/preprosessor/compilation#:~:text=starts%20from%201-,indicator_levelN,-double
that's for showing the level in a separate window, but he wants it on the chart I think so Pauls answer above is more accurate
but I think he's asking for a trend indicator which would just draw a line (DRAW_LINE) at the reversal points
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
Hi
I am trying learning MQL5 programming. I would like to draw horizontal line on the chart swing high and swing low pick.( ie turning point on the chart ) and extend this line to the right of the chart.
Is there any MQL5 function or a library I can use. or any other way.
Please can some point me in the right direction.
thank you