Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Visual Order Processing - MetaTrader 4 Expert | Trading Script Download - MT4/MT5 Resources

author EAcpu | 2 reads | 0 comments |

Visual Order Processing - expert for MetaTrader 4

Order_EA is a simple visual oriented program that uses drag & drop scripts to control order processing.

Take Profit and Stop Loss trend lines are controlled by the local computer - not the broker's computer.

This allows for features such as "one cancels the other" and the ability to automatically close the oldest trade without closing all open trades.

1. Traditional MT4 orders

While a broker's computers process every trade you place, their systems require constant monitoring to take into account the current "roadmap," pullbacks, flags, fundamental announcements, etc.

Even things that are known in advance cannot be programmed and must be entered manually as they occur.

2. Software control order

There is no such thing as a fully automatic trading system for your home computer that can work as well as the human brain. Even those that work well for a short time will fail due to changes in market conditions. Almost all automatic systems enter at the wrong time and provide a very small profit along with a huge stop-loss.

Several systems are available to alert the user when a group of indicators align to produce a good entry point. Most of these systems rely on moving average crossovers. The simple 200-EMA is one example that sometimes works. Unfortunately, these systems are late in identifying the entry point and will totally miss the exit point.

Therefore, this article aims to document a system for placing and maintaining orders generated by human reasoning and mathematical points generated by applying human logic to current price action. While some indicators are useful for calculating waves (such as zig-zag and MACD), software implementations of these methods often fail to generate the correct waves. Some indicators can display the current trend as either up or down but none can correctly draw trend lines bracketing the movement.

Therefore, the human brain, guided by experience, training, rules, and appropriate charting software, is designed to generate easily visualized trends, signs, channels, etc. that can identify entry points, way points, and goals that successfully generate points and profits. These are the trading strategies taught by Scott Buckley.

If you haven't received the proper training to plan your trades, including entry points, targets, and stop moves - you've read too much, close this document and try something else.

What follows is a description of this software package.

three. order processing software

The package consists of two parts:

Input parameters of Order_EA :

Intelligent trading system: Order_EA

This program can run in the background for every currency pair you wish to trade.

Each of the parameters can be customized for the currency pair associated with the EA. This EA is driven from the lines placed on the chart by the included scripts. When the current price touches a line, the requested action will be taken. Note that this process is slower than when a broker is keeping track of the order entry, stop loss, or take profit. There may be some slippage. Also, for this system to function, your computer must be running with the charts up and active.

That said, an EA can enhance normal trading beyond services provided by the broker. The following list of services shows how a few simple changes, such as allowing trigger lines to tilt (follow the trend), can enhance the trading experience. Another example; when an order is placed above the current price and another order is placed below the current price, a "One Cancels Other" situation is created. The first line hit deletes all Orders, Take Profit, and Stop Loss lines in the opposite direction.

EA's stop loss processing:

Unless a set of waypoints is provided, the stop loss line will remain where it was manually placed. Or unless the Order_Fill_21 line is set. Each time the current price reaches the defined waypoint, the stop loss line will advance to the previous waypoint (or order entry) minus 4 points. When the current price exceeds 4 pips per waypoint, a new order will be entered with an additional stop loss.

For the Order_Fill_21 line, the first stop loss is advanced 21 points and a new order (with stop loss) is entered. Stop lines are lined up at 4 pip intervals behind the leading (first) stop line. If there is no waypoint or order execution line, the stop loss will not move automatically. However, a fixed stop can be a diagonal line following a moving average or trendline, effectively creating a "trailing stop."

Please note that the first stop encountered by the price action of this currency pair will cause the oldest order entry to be closed. This sequence continues until the last stop is encountered, at which point all remaining orders are closed. If there is only one stop loss line, all orders will be closed when that line is hit. MetaTrader 4 Stop Loss lines are horizontal and will close all open trades when touched.

Visual Order Processing - expert for MetaTrader 4

EA's take profit processing:

The Take Profit line is not an absolute hard stop as it is when a take-profit line is defined to MetaTrader 4. First off, the MT4 take-profit closes all open trades at the same time. Order_EA users have two options: 1) If EnableTS is set to "true" (default), the following paragraphs describe the TP operation, 2) If EnableTS is set to "false", Order_EA will close the oldest order when the TP line is touched. The last target price line encountered will close all remaining open orders.

When EnableTS is set to true, Order_EA will let profits continue to run until a callback of 4 points is encountered. The oldest order entries will then be closed first and subsequent orders will follow their own take profit and/or stop loss lines. Orders must be closed in the order entered, but not all at the same time. The last hit of the take profit line will close all remaining orders.

When the current price reaches the take-profit line of 10 pips, the take-profit line will be converted into a trailing stop-loss line and will advance to within 20 pips of the current price. For every pip that price action advances, the Trailing Stop will advance by 2 pips – until the Trailing Stop is within 4 pips of the current price. The Trailing Stop line will remain within 4-pips of the current price, even as the current price advances well beyond the old Take Profit line.

There is only one trailing stop line. All remaining Stop Loss and Take Profit lines remain in play until the current Trailing Stop line is taken out by price action. Then the next Take Profit line can create a Trailing Stop. When the last Take Profit line has been processed, all orders are closed.

Each script needs to go from the Navigator Pane to the Chart Window (using the left mouse button) and be placed in the correct location, as most scripts will log where the left mouse button is released. A drop above the current price indicates a "Buy" whereas a drop below the current price is a "Sell". Buys are taken from the Ask price quoted by the broker.


Attachment download

📎 code_12096.zip

Source: MQL5 #12096

Verification code Refresh