Download MetaTrader 5
To add comments, please log in or register
Make screenshots in MetaTrader and manage them in the gallery!
fx-analysis
194
fx-analysis 2009.11.04 18: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
Files:
Tony
280
Tony 2009.11.05 07: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

mee
6
mee 2015.07.02 11: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, 

Files:
/
To add comments, please log in or register