Hello to Everyone!,
I would like to know if is possible to get the datetime from a Vertical Line Object?
img attached!
Thanks in advanced!
Regards!
Script:
//+------------------------------------------------------------------+ //| OBJ_VLINE Info.mq5 | //| Copyright © 2021, Vladimir Karputov | //+------------------------------------------------------------------+ #property copyright "Copyright © 2021, Vladimir Karputov" #property version "1.000" #property script_show_inputs //--- input parameters input string InpName = "VLine"; // VLine Name //+------------------------------------------------------------------+ //| Script program start function | //+------------------------------------------------------------------+ void OnStart() { //--- long chart_id=ChartID(); if(ObjectFind(chart_id,InpName)<0) { Print("ERROR: object ('",InpName,"') not found"); } else { long obj_type=ObjectGetInteger(chart_id,InpName,OBJPROP_TYPE); if(obj_type!=OBJ_VLINE) { Print("ERROR: object ('",InpName,"') is not a 'OBJ_VLINE' - object is ",EnumToString((ENUM_OBJECT)obj_type)); } else { datetime obj_time=(datetime)ObjectGetInteger(chart_id,InpName,OBJPROP_TIME); Print("OBJ_VLINE '",InpName,"' time: ",TimeToString(obj_time,TIME_DATE|TIME_SECONDS)); } } } //+------------------------------------------------------------------+
Script:
Thanks u Very much!
Forget it. Vladimir will no longer offer any help or support for the MT4. He is dedicated to MT5 and MQL5 only!
However, the above code should function for MQL4, and if not, it will only need minor modifications. So try it for yourself. Just change the file extension to ".mql4" and add the "#property strict".
Perhaps you should read the manual. MQL4 Reference → Object Functions → ObjectGetInteger → ENUM_OBJECT_PROPERTY_INTEGER → OBJPROP_TIME
Olvídalo. Vladimir ya no ofrecerá ayuda ni soporte para MT4. ¡Él está dedicado únicamente a MT5 y MQL5!
Sin embargo, el código anterior debería funcionar para MQL4 y, de no ser así, solo necesitará modificaciones menores. Así que pruébalo por ti mismo. Simplemente cambie la extensión del archivo a ".mql4" y agregue "#propiedad estricta".

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello to Everyone!,
I would like to know if is possible to get the datetime from a Vertical Line Object?
img attached!
Thanks in advanced!
Regards!