Problem drawing Vertical line

Back to topics list To post a new topic, please log in or register
avatar
62
fx-analysis 2009.11.04 19:02
 
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
Attached files:
  vlinewalert.mq4  (1.50 KB)
 
avatar
223
Jellybean 2009.11.05 08:54 #
 

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


 
avatar
3
Mee 2015.07.02 13:48 #
 

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, 

Attached files:
  verticalbline.mq4  (1.11 KB)
Back to topics list  

To add comments, please log in or register