<< <%SKIN-STRTRANS-SYNTOC%> >> Navigation: Video Tutorial > Trendline Breakout Automated Entry |
In this tutorial, we're going to create a very useful Expert Advisor. It will buy or sell when the price breaks through a trendline that is drawn in the chart.
Add condition: Price, crosses above, Upper Trendline.
Set Stop Loss...
...it will be added to Inputs.
Set Take Profit the same way.
And create the opposite conditions for sell order.
When the Price crosses below the Lower Trendline, a sell order will be opened.
We have to limit the number of open trades to 1 to prevent multiple orders when the price is oscillating around the trendline.
The Money Management is Fixed.
We can set up audible alerts for each order.
Here we see we have created two inputs – the Stop Loss and Take Profit:
And we will also add the Trade Size, so we have three inputs altogether.
Copy the source and compile it.
Let's try it. Draw two trendlines or horizontal lines in the chart forming a triangle pattern.
Attach the Expert Advisor to the chart.
As soon as the price breaks through one of the trendlines, the order is executed.