int start(){ static datetime Time0; if (Time0 == Time[0]) return; Time0 = Time[0]; VLine("20", Time[20], Red); } void vLine(string name, datetime T0, color clr){ #define WINDOW_MAIN 0 if (!Show.Objects) return; /**/ if (ObjectMove( name, 0, T0, 0 )){} else if(!ObjectCreate( name, OBJ_VLINE, WINDOW_MAIN, T0, 0 )) Alert("ObjectCreate(",name,",VLINE) failed: ", GetLastError() ); if (!ObjectSet(name, OBJPROP_COLOR, clr )) // Allow color change Alert("ObjectSet(", name, ",Color) [1] failed: ", GetLastError() ); if (!ObjectSetText(name, TimeToStr(T0, TIME_MINUTES), 10)) Alert("ObjectSetText(",name,") [1] failed: ", GetLastError()); }

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
Very new to mt4,
Could anyone help me to create a indicator that will trail a vertical line by say 20 candles.