Anyone Have Trading Sessions vlines.1.mq4 Indicator?

 

Hi,

I have an earlier version of the Trading Sessions vLines indicator that doesn't allow for color or style changes of the lines that correspond to the Asian, UK, US sessions.

I went to forex factory and found a link to a v1 that allowed for these changes, but the link is broken.

Can someone be so kind to attach this if you have it? I'd be most grateful.

Cheers,

jboz

 
jbozman:

Hi,

I have an earlier version of the Trading Sessions vLines indicator that doesn't allow for color or style changes of the lines that correspond to the Asian, UK, US sessions.

I went to forex factory and found a link to a v1 that allowed for these changes, but the link is broken.

Can someone be so kind to attach this if you have it? I'd be most grateful.

Cheers,

jboz

Use that MQL search box, search for it and click 'code base' on left panel of search result. Search for any part of it, Trading, or Session, ... you have the idea.

:D

 

I already did that before I posted. Nothing came up in the search.

Unlike others, I try to find before I ask so I don't waste other's valuable time:)

 
jbozman:

I already did that before I posted. Nothing came up in the search.

Unlike others, I try to find before I ask so I don't waste other's valuable time:)

Try http://www.google.com/advanced_search
 

The link seemed to work for me ...

Note that the code is written for 2005 and 2006 only. Other years will not work with daylight saving working correctly.

 
int deinit()
  {
  int items=ArrayRange(objNames,0)-1; Print(items, " objects to delete");
  int i = 0;
//---- 
   //make sure to delete all objects created when unloading this indicator
   //this routine cycles thru the stored list of unique vertical line names 
   //and deletes the objects with that name
   for (i=items; i>=0;i--)
   {
      //all valid object names will have at least one character, so skip empty strings
      if(objNames[i] != "")
      {
         Print("Deleted: ",objNames[i]);
         ObjectDelete(objNames[i]);
      }      
   }
   ObjectsDeleteAll();
//----
   return(0);
  }

This code looked quite reasonable until I got to the ObjectsDeleteAll() at the end. I'm not sure if this was a later modification by somebody else, but it is pretty bizarre.

 

Sometimes I see code and I wonder why the author(s) didn't actually finish writing it.

int start()
  {
   int counted_bars=IndicatorCounted();
   int pos = Bars-1;
   int i = 0;

      

//---- 
   if(Bars - counted_bars == 1) return(0);
   
   pos = (No_Bars_To_Calculate);
   
   //initialize all elements of the array to empty string
   for (i=ArrayRange(objNames,0); i>=0;i--)
   {
      objNames[i] = "";
   }

Here we set a variable, pos, to a certain value. Then we ignore that value, having never used it, and load the variable with another value.

Returning when Bars - counted_bars == 1 is an interesting variant on the once_per_bar method, but I don't think it is better.

 

Thanks everyone. Although I'm not a programmer. So I guess I'll just have to mentally adjust for daylight savings?

When you say the author didn't finish writing it, will this still work? I have the previous (original) version. I wanted to modify the lines...color/style.

If this is problematic, I'll just stick with the original.

Cheers,

 
jbozman:

Thanks everyone. Although I'm not a programmer. So I guess I'll just have to mentally adjust for daylight savings?

When you say the author didn't finish writing it, will this still work? I have the previous (original) version. I wanted to modify the lines...color/style.

If this is problematic, I'll just stick with the original.

Cheers,

>When you say the author didn't finish writing it, will this still work?

That's just me being critical of redundant code which should have been cleaned up. it doesn't affect the functionality at all.

The functionality issues relate to the hard-coded dates of 2006 and 2007 which clearly will not work now. If you work out daylight saving time yourself then that may be ok.

Reason: