Anyone Have Trading Sessions vlines.1.mq4 Indicator?

To add comments, please log in or register
jbozman
127
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

onewithzachy
1863
onewithzachy  
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

jbozman
127
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:)

onewithzachy
1863
onewithzachy  
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
dabbler
1091
dabbler  

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.

dabbler
1091
dabbler  
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.

dabbler
1091
dabbler  

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.

jbozman
127
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,

dabbler
1091
dabbler  
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.

To add comments, please log in or register