Download MetaTrader 5
To add comments, please log in or register
Articles have already helped many traders. Come and read them!
MetaQuotes Software Corp.
Moderator
177147
MetaQuotes Software Corp. 2011.09.27 12:12 

News events and market times on your chart:

Indicator displays News with a market clock.

Author: Tjipke de Vries

bdeyes
76
bdeyes 2011.10.06 02:32  

Hi deVries,


I found another possible issue and I cannot see what needs to be changed/fixed.

I am not getting the "market open" to display properly for the NZ, AS, JP, and HK sessions. Europe, London and NY seem to work fine. See screenshot below.

According to the comments in your code and verified on the worldmarkethours.com site (above) at the time of this screenshot, the New Zealand, Australian and Japan sessions should show as open.


The time calculations in this are challenging my current coding skills.

Any suggestions on what might be going on??

thanks,

dave

P.S. I followed up over here rather than on the donnaforex.com because I am more familiar with how to post here.

Tjipke de Vries
6276
Tjipke de Vries 2011.10.06 22:36  
bdeyes:

Hi deVries,

I found another possible issue and I cannot see what needs to be changed/fixed.

I am not getting the "market open" to display properly for the NZ, AS, JP, and HK sessions. Europe, London and NY seem to work fine. See screenshot below.

According to the comments in your code and verified on the worldmarkethours.com site (above) at the time of this screenshot, the New Zealand, Australian and Japan sessions should show as open.

The time calculations in this are challenging my current coding skills.

Any suggestions on what might be going on??

thanks,

dave

P.S. I followed up over here rather than on the donnaforex.com because I am more familiar with how to post here.


You are playing with the code, this is not the way you have downloaded the indicator the clockdisplay was only to move down and go to the right

This was to avoid to put it at the same corner where the upcoming/recent news events appear. You changed the spread for 5 digit brokers

I guess download the indicator again if you don't have the original I made and see if this indicator does it the way it has to do...

Your the first telling me this.....

So it could be by changing the code you have done something wrong why it is now wrong displayed

heelflip43
92
heelflip43 2011.10.10 14:57  
bdeyes:

Hi deVries,


I found another possible issue and I cannot see what needs to be changed/fixed.

I am not getting the "market open" to display properly for the NZ, AS, JP, and HK sessions. Europe, London and NY seem to work fine. See screenshot below.

According to the comments in your code and verified on the worldmarkethours.com site (above) at the time of this screenshot, the New Zealand, Australian and Japan sessions should show as open.



The time calculations in this are challenging my current coding skills.

Any suggestions on what might be going on??

thanks,

dave

P.S. I followed up over here rather than on the donnaforex.com because I am more familiar with how to post here.

I had the similar issues but from the fix which I came up with it wasn't the fact that I had changed the code for a 5 point broker. The trouble for me was the the StrToTime for Auckland was giving a time for the day before. I fixed it by adding turning the times into strings only. It seems to work.

if(NZDHoliday < TimeCurrent()){
  if ((StrToTime (aucklands) > StrToTime ("9:45"))&& (StrToTime (aucklands) <  StrToTime("10:00"))&& TimeDayOfWeek(auckland) != 0 && TimeDayOfWeek(auckland) != 6)
      {closingSession = "New Zealand opens in " + (60 - TimeMinute(TimeLocal()))+ " mins";}
  if ((auckland > StrToTime ("10:00")) && ((auckland) <  StrToTime("16:45")) && TimeDayOfWeek(auckland) != 0 && TimeDayOfWeek(auckland) != 6)
   {
      openSessions = openSessions + " New Zealand";
      if(TimeHour(auckland) == 16 && TimeMinute(auckland)>14 && TimeMinute(auckland)<45)
       {
         closingSession = "New Zealand closing in " + (45 - TimeMinute(TimeLocal()))+ " mins";
       } 
   }
 }  



bdeyes
76
bdeyes 2011.10.11 16:00  
deVries:
bdeyes:

Hi deVries,

I found another possible issue and I cannot see what needs to be changed/fixed.

I am not getting the "market open" to display properly for the NZ, AS, JP, and HK sessions. Europe, London and NY seem to work fine. See screenshot below.

According to the comments in your code and verified on the worldmarkethours.com site (above) at the time of this screenshot, the New Zealand, Australian and Japan sessions should show as open.

The time calculations in this are challenging my current coding skills.

Any suggestions on what might be going on??

thanks,

dave

P.S. I followed up over here rather than on the donnaforex.com because I am more familiar with how to post here.


You are playing with the code, this is not the way you have downloaded the indicator the clockdisplay was only to move down and go to the right

This was to avoid to put it at the same corner where the upcoming/recent news events appear. You changed the spread for 5 digit brokers

I guess download the indicator again if you don't have the original I made and see if this indicator does it the way it has to do...

Your the first telling me this.....

So it could be by changing the code you have done something wrong why it is now wrong displayed

Hi Tjipke,

Per your suggestion i have downloaded a clean version of the indi from above and ran it as downloaded (without any changes/modifications)

The result was the the same as in my October 6 post (see new screenshot below)

The Market Hours website shows the NZ market is open at 1400 local and AUS market opens 1600 local and both show as closed on indi - at the time of the screenshot both markets are open and indi shows closed.

Maybe a timezone problem? I am in North America (Pacific Daylight Savings Time = GMT-7) and broker time is New York (GMT-4).

I do not understand the other post on this issue, the TimeToString function already converts the time and if it is a current day / previous day problem it seems to me that should only be a problem on the first or last day of the week. However, I will implement a version with that suggestion in it and see what the results are.

Also the clock indicator can be put in the same corner under the news events by simply adjusting the godown and goright values.



thanks,

Dave

Tjipke de Vries
6276
Tjipke de Vries 2011.10.12 17:27  

Thanks bdeyes and heelflip43

Saw the error with changing the timezone of my pc

Made a change in how to get GMT value and used the suggestion of heelflip43

Also made a change for the spread

I only don't know how to put this new version at the top of this topic

So for all it is placed inside http://www.mql4.com/go?http://www.donnaforex.com/forum/index.php?topic=4339.0

bdeyes
76
bdeyes 2011.10.14 20:41  

Hi Tjipke,

Yep, new version seem to solved all those issues. It's working great for me!

I think you have to re-post the indi again to get it on this site. Maybe whoever proofreads the post can help you link it back to this one (or you can put links between the posts).

thanks,

dave

suresh.putta
10
suresh.putta 2015.09.04 06:19  

Hi Tjipke,

 

It's great indicator for the news events, I've not seen such great indicator. Thanks again.

 

Recently i observed news events are not showing up on my metatrador. seems like http://www.dailyfx.com/files/  is not supporting any more. Any suggestions?. 

 

Thanks,

Suresh 

Julian Lo
259
Julian Lo 2015.09.18 06:13  
This is a great indicator but it's no longer working. Hope someone can fix it.
Andi Ahmad
9
Andi Ahmad 2016.02.29 13:45  

Hi ... Is it possible to show all past News lines, not only the future news lines?

Best Regards

Files:
news_line.png 119 kb
/
To add comments, please log in or register