<< <%SKIN-STRTRANS-SYNTOC%> >> Navigation: Video Tutorial > Daily Breakout Strategy |
In this tutorial, we will create an Expert Advisor based on daily breakouts. Generally, breakout systems are proven to be robust and profitable.
Create a new MetaTrader 4 Strategy and call it Daily Breakout.
Add condition: Price (the MetaTrader charts show the Bid price), crosses above, Resistance. The Time Interval will be 12 hours at Fixed time of the day and the Time Interval ends at 10 o'clock.
We won't set the Stop Loss because we're going to use Trailing Stop instead. But we will set the Take Profit to 100 Pips.
Now create the opposite to sell.
The price crosses below Support and the Take Profit is 100 Pips. That's correct.
(A word of advice: if the website becomes a bit slow due to the number of conditions, just hit Ctrl+R to refresh – it helps.)
Instead of closing the trade, we will use the Take Profit and Trailing Stop. In the Common tab, add Trailing Stop.
For long positions, the Trailing Stop will be at Support, the last 12 bars, and we don't want to draw it on the chart because it would draw too many lines as the Stop Loss has moved.
Create the opposite Trailing Stop for short positions.
Because we still haven't limited the number of trades, the order will be sent multiple times when the price moves around the support or resistance. We want to send the next order on the next day. So we check Next Open Trade After Time Of The Day: 10 o'clock, which is the ending time of the support or resistance interval.
In Money Management, we will use fixed size of 1 minilot and we can set it as input.
The Source is ready... that's pretty fast work!
Copy the source and compile it.
Let's test it in Strategy Tester.
We see that support and resistance are shown as blue lines. The support is broken, the order is executed and both Stop Loss and Take Profit are set. As the trade moves our way, the Stop Loss is trailed.
For now, we are not interested in performance because we will optimize the Take Profit and other parameters in the next videos in this tutorial.