Automatic Breakout is an expert advisor written in the MQL5 language for MetaTrader 5 and is designed to catch trends early and follow the trend for the duration of the trend based on user inputs vol_per_hundred, timeframe and total_bars. With advanced automated money management and strict trading rules, the expert advisor removes emotion and human error from trading decisions. The expert advisor performs automated precisely executed trading decisions around the clock without delay as long as your trading terminal is active and the expert advisor is attached to your desired chart.
The expert simply trades on breakouts of two horizontal breakout levels. The breakout levels have a simple formula for determining the breakout level price values. A horizontal highest price level based on price highest for the expert advisor user inputs timeframe and total_bars (recent previous number of bars) and a horizontal low price level based on the lowest price for user inputs timeframe and total_bars (recent previous number of bars) for the currency pair that the expert advisor has been attached to.
Only one open position for the currency pair that the expert advisor is attached to is allowed by the expert advisor at any time, and the expert advisor will only trade the currency pair for the chart that it is attached to. Either a buy position, sell position or no open position can exist for the currency pair that the chart is attached to.
If an open buy position exists then the expert will maintain and update a stop loss at the low horizontal breakout level.
If an open sell position exists then the expert will maintain and update a stop loss at the high horizontal breakout level.
If a stop loss is reached on your broker's server then the open position will be closed automatically by the broker based on the stop loss level that was automatically adjusted in real time by the expert advisor. This means that the open position will close at the stop loss level even if your MetaTrader terminal is disconnected from the broker's server when the stop loss is reached. Effectively this ensures that if the price is greater than or equal to the high breakout level an existing sell position will be closed and if the price is lower than or equal to the low breakout level an existing buy position will be closed.
The existence of no open positions for the chart currency pair that the expert advisor is attached to allows for a deal to be opened based on the following rules. If no position is found for the chart that the expert advisor is attached to, the expert advisor will initiate a buy position if the price is greater than or equal to the upper breakout price level and a sell position if the price is lower than or equal to the lower breakout price level. The closing of a position is always followed by the opening of a new position in the opposite direction. A stop loss is placed when the deal is initiated. While the position is open the position is monitored for stop loss updates and If a new stop loss is required based on a change in the breakout level, the expert advisor will send an appropriate stop loss adjustment request to the broker's server.
- vol_per_hundred - Deal execution volume for every 100 units of account equity prior to deal execution (0.01 recommended).
- timeframe - The timeframe used for high and low breakout level calculations. Any timeframe is possible (weekly recommended).
- total_bars - The number of recent previous bars to consider in highest/lowest calculations for determining high/low breakout levels.
In summary, Automatic Breakout expert advisor uses breakout of horizontal stop loss controlled support levels to close an existing position. The close of an existing trade occurs when the automated breakout based stop loss level is reached on the broker's server. A trade in the opposite direction to the previous position is allowed and applied after no open position status is confirmed. The application of a stop loss exit is important for protecting the equity from runaway losses during internet connection/power failure periods because the broker "remembers" your stop loss level.