You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
snelle_moda:
Hi
When I would live in the USA, you're correct with your statement and my pc time would automatically change to the new summer time at (10-03-2013). BUT!!! I live the the Netherlands. In Europe, the summer time will be adjusted on the last Sunday on March 31-03-2013, thats 2.5 weeks from now. So between 10-03-2013 till 31-03-2013 there is a 1 hour time shift. All events in the USA are one hour earlier in Europe. My model needs to check this.
I have carefully read this topic, interesting. But I still do not understand why you need to do this calculation.
Between these periods, there are 2/3 weeks in March and October that there is a time difference of 1 hour between Europe and America. My EA needs to detect this time change to adjust some trading time variables that are used for the event calendar (US: Jobless claims, PPI, CPI etc.).
As I understand, Economic calendar time is adjust to server time. If you have some trading time parameters in your EA, why don't adapt these parameters with server time of your broker ? Unless you want a universal solution for the distribution of your EA or I miss something.
I use my local computer time for the "date and time" variables because of convenience. Using the server time of the broker makes things overcomplicated because each broker has its own server time, I have 2 live accounts at two different bokers and I use the demo simulation account of MetaQuotes.
So I want a universal solution for this problem because there are only two periods in a year when this situation occurs, in the month march and october/november. For the other months, everything is working fine.
I use my local computer time for the "date and time" variables because of convenience. Using the server time of the broker makes things overcomplicated because each broker has its own server time, I have 2 live accounts at two different bokers and I use the demo simulation account of MetaQuotes.
So I want a universal solution for this problem because there are only two periods in a year when this situation occurs, in the month march and october/november. For the other months, everything is working fine.
Thank you for explanation.
For an universal solution, I think what phi.nuts propose is better. I'll do a search and I'll let you know if I find something.
Hi snelle_moda,
I don't observe DST, but I coded something similar like DST (though I did not finished it, but still remember the logic), you know something like "Find date of last third Sunday November 2009"..
You just wait I'll try to code that again.
Hi snelle_moda,
I don't observe DST, but I coded something similar like DST (though I did not finished it, but still remember the logic), you know something like "Find date of last third Sunday November 2009"..
You just wait I'll try to code that again.
Hi guy's.
I have finished the script for both periods (March and October/November).
Maybe there are a few small bugs left but the principle is clear.
The script checks if the current date is between the 2e Sunday till the last Sunday of March or between the last Sunday of October and the first Sunday of November.
The script uses two loops:
The first loop goes back in time to 01-01-20XX to check the first day of the year (day of the week number). It also count the number of sunday's that has elapsed since the end of the month.
The second loop goes from 01-01-20XX to the present to count the number of sunday's that has elapsed since the start of the month.
I know the code is a little bit crappy but I'm a novice programmer. I think a good programmer can make this code more simple.
Here is an example, maybe that helps you further.
earlyBird1.mq4 - MQL4 Code Base
Hi
This method is also a possibility but you have to manually adjust the summer/winter time dates for each new year.
So this solution is not desirable.