Building an Expert Advisor to manage a manually drawn trend line


The FX TrendLine Plug-in can monitor any trend line on a chart.  It does this by searching for a trend line by name.


After you manually draw your trend line on your price chart, record the exact name of the trend line. This name will be referenced in your Expert Advisor by the fnIsTrendLineBroken.


To build an Expert Advisor that opens a BUY trade when a trend line has been broken, drag and drop the TrendLine function fnIsTrendLineBroken on to the OpenBuyOrder drawing pad and connect it before the Logic element IsOpenBuyTrue.


Set the parameters of the fnIsTrendLineBroken function:



After connecting and configuring the fnIsTrendLineBroken function, configure the IsOpenBuyTrue Logic element to test for the break.  The function IsOpenBuyTrue returns a value of true if/when the line is broken.



The full OpenBuyOrder drawing is shown below.





Related Topics:
What is VTS
Why use VTS
Installing VTS
Everything You Need To Know About VTS
Expert Advisor Facts
Configure
Configure
Custom Indicators
MQL Function
TEXT Element
INPUT Manager
TRADETIME Manager
TRADESIGNAL Manager
COMMUNICATION Manager
OPENTRADE Manager
Message
Logic
MetaTrader Platform Configuration
Compiler
Compiler Flags
Special Functions
fnOpenOrder
init and deinit
MetaTrader Platform
ECN Brokers
Step 2
Function and Logic Power Plug-in
Logic
Candlestick Plug-in
Using a Candlestick Function in a Logic Element
Easy Email Plug-in
Configure Easy Email Settings
Using Easy Email from the Communication Manager
Using Easy Email from any Element
Using Easy Email with the fnSendEzEmail Function
Testing the Easy Email Connection
TrendLine Plug-in
Building an Expert Advisor to draw and manage a trend line
Grid Plug-in
FX PowerGrid Functions
Grid Main Settings
fnRemoveLines
Using FX PowerGrid
Script & Multi-Platform Plug-in
Building a MetaTrader Script
Using the Multi-Platform Feature
Profit Exits Plug-in
Profit Manager Plug-in
Target
Action
Price Chart
Client-Side Stops Plug-in
Emergency Stops
Using Client-Side Stops
Fibonacci Trader Plug-in
Building an Expert Advisor to manage a manually drawn Fibonacci retracement
Building an Expert Advisor to draw and manage a Fibonacci retracement
Signal Aggregator Plug-in
Signal Type: MQL
MQL-Mentor Plug-in
Partial-Close Plug-in
Partial-Close Price Chart
EA-Indicator Plug-in
Using the EA-Indicator Plug-in
Custom Indicators in the Toolbox
EA-Indicator Video
Chart Objects Plug-in
Market Score Plug-in
Order History Plug-in
EA Secure Plug-in
EA Secure Configuration
Chart Execute Plug-in
Money Manager Plug-in
Money Manager Configuration
Money Management Table
Package Plug-in
Pivot Points Plug-in
Using the Pivot Point Plug-in
File IO Plug-in
Multi Trade Plug-in
Debug Manager Plug-in