Receive the latest alerts via email

Time based orders in MT4

The short summary is that time based orders in MT4 are possible. You just need to keep in mind some of the technical limitations. MetaTrader 4 EAs work based off of incoming ticks. Whenever the bid/ask changes by a micro pip or more, that event triggers the EA to do something. When the markets hum…
Time based orders in MT4

The short summary is that time based orders in MT4 are possible. You just need to keep in mind some of the technical limitations. MetaTrader 4 EAs work based off of incoming ticks. Whenever the bid/ask changes by a micro pip or more, that event triggers the EA to do something.

When the markets hum along at a rapid pace, this effect is not noticeable. When the quote flow slows down, however, it can cause the EA to sleep entirely through your trading window.

Many news traders want to bracket buy and sell stops around the price at 08:29 on NFP Friday. Everyone knows that a major news event is about to release. Trading slows down, as does the flow of quotes. The pending orders may not set in time if an incoming tick does not arrive in the 60 seconds between 08:29 and 08:30. This seems unlikely to many novice traders, but it happens frequently enough that we inevitably receive these types of questions whenever we program a time-based order placement EA.

The workaround typically satisfies most traders. EAs place an order at the first available tick within a certain time window. Using NFP as the example, the EA might seek to place bracket orders around the first tick between 08:29-08:32. The chances of making it 2 minutes past 08:30 without a single tick are low. And given that you are taking the first tick, the orders will succesfully bracket around the price the vast majority of the time. It is important to keep in mind how the backend works for those one-off events where the orders do not function as desired.

MetaTrader 5 addresses MT4’s time weakness by offering event driven programming. It is possible to rewrite MQL4 EAs into MQL5 and to demand an action at a precise moment in time. The MQL5 timer actively watches the clock. Regardless of what the markets do, the EA can know to wake up and do whatever action is needed. This is one of the few scenarios where converting from MQL4 into MQL5 comes with obvious advantages.

Total
0
Shares
Previous Post

We expect RA to trend downwards right now.

Next Post

After testing 1719.5000 numerous times, Gold AUGUST 2020 is once again approaching this price point. Can we expect a bearish trend to follow?

Related Posts
Getting to Grips with the Guppy

Getting to Grips with the Guppy

One of the most frustrating things about constructing a trading system can be the absolute freedom to use whatever indicators and values you like. While this can initially sound positive, the virtually limitless combinations of variables can become quite overwhelming. For example, if you like the concept of the SPY 10/100 SMA Long Only System…
Read More
Why use Repainting Indicators in MetaTrader?

Why use Repainting Indicators in MetaTrader?

Repainting indicators are one of the most common problems facing would-be EA designers. Sometimes it seems like an indicator has its thumb on the market. It perfectly predicts when the market will go up or down. So making an EA run off of the indicator is a no-brainer. If this sounds familiar, you need to…
Read More
Setting the Day Trading Ground Rules

Setting the Day Trading Ground Rules

Day trading is challenging. Don’t let anyone tell you otherwise. The odds are stacked against you, and the risk of loss lurks at every turn. That’s why it’s important to understand the ground rules of day trading. Start with your Range One of the most common mistakes with day trading is failing to identify the…
Read More