Problem drawing Vertical line

 
Hello, I want to make indicator to draw vertical line at certain date and certain time, but I don't get a line. What is wrong ? If I look at objects list after inserting indicator, I find Vertical line with date parameters: 1970.01.01 00:00 Thanks, Edward
Files:
 

Hi edas

Your code has two problems.

1. Your parameter "2009/11/04" should be the window number for the line to be drawn in, e.g. 0.

2. The format for the datetime constant "2009/11/04" is wrong. It should be D'2009.11.04 15:00'.

Also, the 5th parameter is unused.

All this can be found in the "Dictionary" tab in the editor.

Try this.


int start()
  {
//   int    counted_bars=IndicatorCounted();
   datetime When = D'2009.11.04 1:00';
   int Unused = 0;

//      ObjectCreate(LineName, OBJ_VLINE, "2009/11/04","15:00", Bid);
      ObjectCreate(LineName, OBJ_VLINE, 0, D'2009.11.04 1:00', Unused );
      ObjectSet(LineName, OBJPROP_STYLE, LineStyle);
      ObjectSet(LineName, OBJPROP_COLOR, LineColor);
        
//----
//----
   return(0);
  }

Cheers

Jellybean

 

Hi,

 

I have no experience in coding and I have this indi, but would not work on new MT4. Is there anyone who has the new indi or could help fix it?

 

Thanks in advance.

Rob, 

Files:
Reason: