5.00
(4 Ratings)

Algorithmic Trading in MQL5: Master Date and Time

Wishlist Share
Share Course
Page Link
Share On Social Media

About Course

Are you looking to trade or not trade specific hours or days of the week? Then this course is for you.

Date and Time, a Complex Subject

Working with date and time is not as simple as it might seem. There are several factors that influence them. For instance: some months have 4 weeks, others have 5 weeks; some months have 31 days, others have 30 days, February has 28 days and in some years it has one extra day.

When it comes to time, accommodating to diurnal cycles causes that the same point in time is different for different countries or regions. When London wakes up at 7 am, in US it is still 2 am.

But that is not all, to make things even more challenging, some regions or countries will also forward the clock one hour during Summer time while others do not, and Summer time is also different for different regions!

Complexity does not end here, but I think you can already see the point. Accounting for dates and time can turn crazy anyone, but here in this course we step into it and we work with date and time while accounting for all of these issues.

Date and Time in MQL5

Here is the approach that we will take to approach this subject.

First, we will create a day of the week filter, so we can restrict trading to specific days of the week. Next, we move into the time part. We start with the theory and rapidly move to the code. Here you will learn:

  1. – how to implement a timer to only trade a specific time range or trading session
  2. – how to implement two or even more timers so you can trade multiple sessions separated by a break
  3. – how to exit your positions at a specific time
  4. – how to do all of that while accounting for time zone differences and Summer time (DST)
  5. – how to locate specific days of the week within a month (e.g. first Sunday, last Monday…)

During the course we will demonstrate how to implement all these techniques into an expert advisor, the Simple MA v2.0, which is the one we code in “Algorithmic Trading in MQL5: OOP & PO”, but that expert advisor is not provided in this course. In this course we will provide you with the Time include file, which contains all code explained during the course.

Is this course for me?

This course is an advanced level course. It is not appropriate for beginners as we will not cover the basics of the MQL5 language. Beginners should take instead “Algorithmic Trading In MQL5: Code Robots & Free Up Your Time”.

The course also follows an Object-Oriented approach, so you also need to have knowledge of OOP or have completed “Algorithmic Trading in MQL5: OOP & PO” first.

If you took the time to complete the previous courses, or you have intermediate knowledge of MQL5, then you are ready to take this course.

I am confident that you will find great value on all the knowledge and techniques shared in this course.

If you like the program and you are interested on improving your MQL5 skills and your trading robots, then wait no more! This course is for you!

– Jose Martinez

Show More

What Will You Learn?

  • How to trade on specific days of the week.
  • How to code a timer to trade within a time range or trading session.
  • How to trade multiple time ranges or sessions.
  • How to find specific days of the week within a month (e.g. first Sunday).
  • How to adjust the timer for the time zone and DST.
  • How to exit positions at a specific time.

Course Content

Date and Time

  • 00:10
  • Introduction, date and time
    12:11
  • 11:31
  • Introduction to the Time Class
    07:11
  • Time Zone and DST Adjustment
    13:23
  • DST Date Methods
    16:57
  • Timer and Exit Time Signals
    07:38
  • Implementation of Time Class
    16:40
  • Two-session Timer and Exit Time
    12:39
  • Conclusion
    02:41

Student Ratings & Reviews

5.0
Total 1 Rating
5
4 Ratings
4
0 Rating
3
0 Rating
2
0 Rating
1
0 Rating
GS
6 months ago
This course was an eye-opener for me. I anticipated the challenges of working with time but had no idea of how to implement them in my expert advisors. Thank you José for this amazing course.